authenticate
Authenticates a time-based one-time passcode from the user's authenticator app. Calls the POST /sdk/v1/totps/authenticate endpoint.
Kotlin:
StytchConsumer.totps.authenticate(
TOTPsAuthenticateParameters(totpCode = "123456", sessionDurationMinutes = 30)
)Content copied to clipboard
iOS:
let params = TOTPsAuthenticateParameters(totpCode: "123456", sessionDurationMinutes: 30)
let response = try await StytchConsumer.totps.authenticate(params)Content copied to clipboard
React Native:
StytchConsumer.totps.authenticate({ totpCode: "123456", sessionDurationMinutes: 30 })Content copied to clipboard
Return
TOTPsAuthenticateResponse containing the authenticated session and user.
Parameters
request
ITOTPsAuthenticateParameters
totpCode— The 6-digit code from the user's authenticator app.sessionDurationMinutes— Duration of the session to create, in minutes.
Throws
StytchError
if the code is invalid or expired.
if the coroutine is cancelled.