MongocampRegister
Server 3.0 registration page (AUTH_REGISTRATION=open or invite) — put it on the page of paths.register (default /register), the path of the invitation links the server mails. The page must be public (outside the protected routes).
vue
<!-- pages/register.vue -->
<template>
<MongocampRegister />
</template>- Open registration — e-mail address, optional display name, password (at least
minPasswordLength, the server'sAUTH_PASSWORD_MIN_LENGTH) and its repetition ⇒useMongocampAuth().register(…). The server answers202whether or not the address exists, so the page always says if the address can be registered, a confirmation mail is on its way — the link goes toMongocampVerifyEmail. WithAUTH_REQUIRE_VERIFIED_EMAILthe user can log in only after confirming. - Invitation — with
?token=(the link of an invitation fromMongocampUsers' Invite User) the heading is Accept the invitation and the token goes with the registration asinviteToken: the address counts as confirmed and the user gets the invitation's roles; the page then offers Log in. A used, expired or unknown invitation (400, code4403) says so. - Registration switched off (
404) ⇒ Registration is not open on this server.; too many attempts (429) ⇒ the wait; other refusals ⇒ the server's message. - In server proxy mode a note instead of the form (there is no login).
The server sends no mail itself — the app listens to the Nitro hook mongocamp:auth:mail (see Authentication flows).
Props
| Prop | Type | Default | Description |
|---|---|---|---|
minPasswordLength | number | 8 | The server's AUTH_PASSWORD_MIN_LENGTH. |
loginPath | string | module option loginPath | Where Log in goes after the registration. |
hideHeading | boolean | false | Hide the heading inside the card. |
Slots and events
header / footer slots inside the card, like MongocampLogin. registered({ email, invited }) after the server took the registration.