authenticate
Authenticates a magic link token received via deeplink, establishing a member session. Calls the POST /sdk/v1/b2b/magic_links/authenticate endpoint. Retrieves the PKCE code verifier stored during the corresponding B2BEmailMagicLinksClient.loginOrSignup call, and automatically includes the intermediate session token if one is present.
Kotlin:
StytchB2B.magicLinks.authenticate(
B2BMagicLinksAuthenticateParameters(
magicLinksToken = "token",
sessionDurationMinutes = 30,
)
)iOS:
let params = B2BMagicLinksAuthenticateParameters(magicLinksToken: "token", sessionDurationMinutes: 30)
let response = try await StytchB2B.magicLinks.authenticate(params)React Native:
StytchB2B.magicLinks.authenticate({ magicLinksToken: "token", sessionDurationMinutes: 30 })Return
B2BMagicLinksAuthenticateResponse containing the authenticated member session.
Parameters
IB2BMagicLinksAuthenticateParameters
magicLinksToken— The token extracted from the magic link deeplink URL.sessionDurationMinutes— Duration of the session to create, in minutes.locale?— Locale used for any follow-up communications.
Throws
if the token is invalid, expired, or no PKCE verifier is found in storage.
if the coroutine is cancelled.