recover
Authenticates the user with a TOTP recovery code instead of a time-based code. Calls the POST /sdk/v1/totps/recover endpoint. Each recovery code can only be used once.
Kotlin:
StytchConsumer.totps.recover(
TOTPsRecoverParameters(recoveryCode = "recovery-code", sessionDurationMinutes = 30)
)Content copied to clipboard
iOS:
let params = TOTPsRecoverParameters(recoveryCode: "recovery-code", sessionDurationMinutes: 30)
let response = try await StytchConsumer.totps.recover(params)Content copied to clipboard
React Native:
StytchConsumer.totps.recover({ recoveryCode: "recovery-code", sessionDurationMinutes: 30 })Content copied to clipboard
Return
TOTPsRecoverResponse containing the authenticated session and user.
Parameters
request
ITOTPsRecoverParameters
recoveryCode— A one-time-use recovery code issued during TOTP setup.sessionDurationMinutes— Duration of the session to create, in minutes.
Throws
StytchError
if the recovery code is invalid or has already been used.
if the coroutine is cancelled.