From 321c2b14a56048a66c42629f22c208ae75e6d52d Mon Sep 17 00:00:00 2001 From: Martin Dosch Date: Sat, 13 Apr 2024 12:08:36 +0200 Subject: [PATCH] FAST: Add option to invalidate current fast token. --- xmpp.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xmpp.go b/xmpp.go index d50d7cd..9bd55aa 100644 --- a/xmpp.go +++ b/xmpp.go @@ -269,6 +269,10 @@ type Options struct { // XEP-0484: Fast Authentication Streamlining Tokens // Fast Mechanism FastMechanism string + + // XEP-0484: Fast Authentication Streamlining Tokens + // Invalidate the current token + FastInvalidate bool } // NewClient establishes a new Client connection based on a set of Options. @@ -639,7 +643,11 @@ func (c *Client) init(o *Options) error { } fastAuth = fmt.Sprintf("", nsFast, mech) } else { - fastAuth = fmt.Sprintf("", nsFast) + var fastInvalidate string + if o.FastInvalidate { + fastInvalidate = " invalidate='true'" + } + fastAuth = fmt.Sprintf("", nsFast, fastInvalidate) tlsState := tlsConn.ConnectionState() mechanism = o.FastMechanism switch mechanism {