Resets forgotten passwords. The client's /login page asks for a reset link, which the email takes to the /reset-password page, whose token names the reset.

  • POST /api/password-resets — public. Emails a reset link to the account with that email, if any; always answers 200.
  • PUT /api/password-resets/:token — public, with a reset token. Sets the newPassword, which ends the user's sessions here and on the instances they signed in to.

Variables

v
default: Router

Mounted by api/main.ts behind the error, Open Graph and CORS middleware. An APIException thrown by a handler becomes the JSON error response there.

Usage

import * as mod from "api/routes/password-resets.ts";