resetBySession
abstract suspend fun resetBySession(request: IPasswordsSessionResetParameters): PasswordsSessionResetResponse
Resets a user's password using their active session for verification (no existing password required). Calls the POST /sdk/v1/passwords/session/reset endpoint. Requires an active session.
Kotlin:
StytchConsumer.passwords.resetBySession(
PasswordsSessionResetParameters(password = "newpassword")
)Content copied to clipboard
iOS:
let params = PasswordsSessionResetParameters(password: "newpassword")
let response = try await StytchConsumer.passwords.resetBySession(params)Content copied to clipboard
React Native:
StytchConsumer.passwords.resetBySession({ password: "newpassword" })Content copied to clipboard
Return
PasswordsSessionResetResponse containing the updated session and user.
Parameters
request
IPasswordsSessionResetParameters
password— The new password to set for the currently authenticated user.sessionDurationMinutes?— Duration of the session to create, in minutes.
Throws
StytchError
if no active session exists or the password does not meet strength requirements.
if the coroutine is cancelled.