Skip to content

MongocampResetPassword ​

Server 3.0 "forgot password" and reset page (AUTH_PASSWORD_RESET=true) — put it on the page of paths.resetPassword (default /reset-password, the path of the mailed link); it must be public. MongocampLogin's forgot-password prop links to it.

vue
<!-- pages/reset-password.vue -->
<template>
  <MongocampResetPassword />
</template>
  • Without ?token= — the e-mail address ⇒ useMongocampAuth().requestPasswordReset. The server answers 202 for any address, so the page always says if an account has this address, a mail … is on its way.
  • With ?token= (the mailed link) — a new password (at least minPasswordLength) and its repetition ⇒ resetPassword(token, password); then Log in and reset is emitted. The reset ends every token and session of the account (the page says so). A used, expired or unknown link (400, code 4403) switches to the request form with This link is no longer valid.
  • Reset switched off (404 — without AUTH_PASSWORD_RESET the routes do not exist) ⇒ Password reset is not switched on on this server.; 429 ⇒ the wait. In proxy mode a note.

Props ​

PropTypeDefaultDescription
minPasswordLengthnumber8The server's AUTH_PASSWORD_MIN_LENGTH.
loginPathstringmodule option loginPathWhere Log in goes.
hideHeadingbooleanfalseHide the heading inside the card.

header / footer slots as in MongocampLogin.

Released under the MIT License.