function resetPassword
resetPassword(
token: string,
newPassword: string
): Promise<string>

Sets newPassword for the user of a reset token, marks the token used, and returns the user's id. Through updateUser, this ends the user's sessions here; the route tells the instances they signed in to.

Parameters

token: string
newPassword: string

Return Type

Promise<string>

Throws

APIException

400 when the password's length is out of bounds or the token is invalid or expired, 404 when the token isn't on record or its user is gone, 409 when it has been used.

Usage

import { resetPassword } from "api/services/password-reset-service.ts";