reset

abstract suspend fun reset(request: IB2BPasswordEmailResetParameters): B2BPasswordEmailResetResponse

Completes the email password reset flow by setting a new password using the token from the reset link. Calls the POST /sdk/v1/b2b/passwords/email/reset endpoint. Retrieves the PKCE code verifier stored during the corresponding resetStart call, and automatically includes the intermediate session token if one is present.

Kotlin:

StytchB2B.passwords.email.reset(
B2BPasswordEmailResetParameters(
passwordResetToken = "token",
password = "newpassword",
sessionDurationMinutes = 30,
)
)

iOS:

let params = B2BPasswordEmailResetParameters(
passwordResetToken: "token",
password: "newpassword",
sessionDurationMinutes: 30
)
let response = try await StytchB2B.passwords.email.reset(params)

React Native:

StytchB2B.passwords.email.reset({
passwordResetToken: "token",
password: "newpassword",
sessionDurationMinutes: 30,
})

Return

B2BPasswordEmailResetResponse containing the authenticated member session.

Parameters

request
  • IB2BPasswordEmailResetParameters

  • passwordResetToken — The password reset token extracted from the deeplink URL.

  • password — The new password to set for the member.

  • sessionDurationMinutes — Duration of the session to create, in minutes.

  • locale? — Locale for any follow-up communications.

Throws

StytchError

if the token is invalid or expired, or if no PKCE verifier is found in storage.

if the coroutine is cancelled.