From 365fa4a017cc8db811cae66301795a0721807343 Mon Sep 17 00:00:00 2001 From: mickmak-busicat Date: Wed, 4 Sep 2024 12:22:16 +0800 Subject: [PATCH 1/3] Add description to xState in authenticate --- Sources/Authgear.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Authgear.swift b/Sources/Authgear.swift index 72f52ef..cb7f192 100644 --- a/Sources/Authgear.swift +++ b/Sources/Authgear.swift @@ -813,6 +813,9 @@ public class Authgear { _ = handleWechatRedirectURI(url) } + + /// - Parameters: + /// - xState: Use this parameter to provide parameters from the client application to Custom UI. The string in xState can be accessed by the Custom UI. Ignore this parameter if default AuthUI is used public func authenticate( redirectURI: String, state: String? = nil, From 9d76cfc5654fde502591fbc062c3837498bcd0ff Mon Sep 17 00:00:00 2001 From: mickmak-busicat Date: Wed, 4 Sep 2024 12:23:07 +0800 Subject: [PATCH 2/3] Hide not used params in public function --- Sources/Authgear.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Sources/Authgear.swift b/Sources/Authgear.swift index cb7f192..d13c56d 100644 --- a/Sources/Authgear.swift +++ b/Sources/Authgear.swift @@ -818,10 +818,8 @@ public class Authgear { /// - xState: Use this parameter to provide parameters from the client application to Custom UI. The string in xState can be accessed by the Custom UI. Ignore this parameter if default AuthUI is used public func authenticate( redirectURI: String, - state: String? = nil, xState: String? = nil, prompt: [PromptOption]? = nil, - loginHint: String? = nil, uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, wechatRedirectURI: String? = nil, @@ -833,10 +831,10 @@ public class Authgear { redirectURI: redirectURI, isSSOEnabled: self.isSSOEnabled, preAuthenticatedURLEnabled: self.preAuthenticatedURLEnabled, - state: state, + state: nil, xState: xState, prompt: prompt, - loginHint: loginHint, + loginHint: nil, uiLocales: uiLocales, colorScheme: colorScheme, wechatRedirectURI: wechatRedirectURI, From bbc2c3e74fe35958532e084d96b875460b44e71b Mon Sep 17 00:00:00 2001 From: mickmak-busicat Date: Thu, 5 Sep 2024 13:22:12 +0800 Subject: [PATCH 3/3] Update reauthenticate and promoteAnonymousUser for state parameter documentation --- Sources/Authgear.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Sources/Authgear.swift b/Sources/Authgear.swift index d13c56d..cb75075 100644 --- a/Sources/Authgear.swift +++ b/Sources/Authgear.swift @@ -813,7 +813,6 @@ public class Authgear { _ = handleWechatRedirectURI(url) } - /// - Parameters: /// - xState: Use this parameter to provide parameters from the client application to Custom UI. The string in xState can be accessed by the Custom UI. Ignore this parameter if default AuthUI is used public func authenticate( @@ -853,9 +852,10 @@ public class Authgear { } } + /// - Parameters: + /// - xState: Use this parameter to provide parameters from the client application to Custom UI. The string in xState can be accessed by the Custom UI. Ignore this parameter if default AuthUI is used public func reauthenticate( redirectURI: String, - state: String? = nil, xState: String? = nil, uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, @@ -899,7 +899,7 @@ public class Authgear { let options = ReauthenticateOptions( redirectURI: redirectURI, isSSOEnabled: self.isSSOEnabled, - state: state, + state: nil, xState: xState, uiLocales: uiLocales, colorScheme: colorScheme, @@ -981,9 +981,10 @@ public class Authgear { } } + /// - Parameters: + /// - xState: Use this parameter to provide parameters from the client application to Custom UI. The string in xState can be accessed by the Custom UI. Ignore this parameter if default AuthUI is used public func promoteAnonymousUser( redirectURI: String, - state: String? = nil, xState: String? = nil, uiLocales: [String]? = nil, colorScheme: ColorScheme? = nil, @@ -1023,7 +1024,7 @@ public class Authgear { redirectURI: redirectURI, isSSOEnabled: self.isSSOEnabled, preAuthenticatedURLEnabled: self.preAuthenticatedURLEnabled, - state: state, + state: nil, xState: xState, prompt: [.login], loginHint: loginHint,