Verify Your Email
An account cannot sign in until its email address is verified. When you
register, Restfall emails you a link; opening it, and
entering the password you registered with, verifies the address and signs you
in. Until then every sign-in is refused (below), and nothing else about the
account is usable, because every token comes from a sign-in (and any token
the account might hold anyway is refused as an unknown one, 401: see
log in).
Accounts that existed before email verification was introduced count as verified.
The link
The email holds one link to the web client’s verification page:
https://YOUR-RESTFALL-HOST/verify-email#token=...The token is the part after #token=. It sits in the link’s fragment, which
your browser never sends to any server, so it reaches no server’s log on the
way to the page; the page takes it out of the address bar as soon as it
opens. If your mail program rewrites links and the page opens without its
token, it asks for the link from your verification email: copy the whole link
from the email into the address bar, or ask for a new link (below).
The page asks for your password and sends the token and the password together. Opening the link alone changes nothing, so a mail program that opens links to scan them verifies nothing either. Both are needed on purpose: the token proves you read the mailbox, the password proves you are the person who registered. Someone who registered your address with their own password cannot get you to verify their account for them, and someone who reads the email cannot use the link without the password.
- A link works for 24 hours.
- It works once.
- A newer link replaces it: asking for a new one (below) makes every older link stop working.
- A wrong password is answered exactly as a wrong password at
log in is,
400 Bad RequestwithInvalid credentials., and the link keeps working: try again. - A link that is unknown, expired, already used or replaced gets one answer,
whatever the reason:
410 GonewithThis verification link is not valid any more. Ask for a new one.Ask for a new link.
So a client tells the two apart by the status alone: 400, ask for the
password again; 410, offer “send me a new link”.
Verify from your own code
POST /api/v1/users/verify-email/ takes the link’s token, your
password and the web client’s human check,
turnstile_token. It answers exactly as log in does: an
account token, the same kind, under the same
token limit.
import httpx
response = httpx.post( "http://localhost:8731/api/v1/users/verify-email/", json={ "token": "the-token-from-the-link", "password": "yourpassword", "turnstile_token": "the-token-from-the-widget", },)token = response.json()["auth_token"]curl -X POST http://localhost:8731/api/v1/users/verify-email/ \ -H "Content-Type: application/json" \ -d '{"token": "the-token-from-the-link", "password": "yourpassword", "turnstile_token": "the-token-from-the-widget"}'const response = await fetch("http://localhost:8731/api/v1/users/verify-email/", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ token: "the-token-from-the-link", password: "yourpassword", turnstile_token: "the-token-from-the-widget", }),});const { auth_token } = await response.json();{ "auth_token": "your-token-here"}A verification counts as a sign-in for the
sign-in rate limits: per
client address, per address and account, and per account. A successful one
makes your address known, as a
successful log in does. A deactivated account is refused with
400 Bad Request and User account is not active., and stays unverified.
The link is read before the human check is: a dead link is the 410 even
with a human-check token that would not pass. For a working link the check
comes after the rate limits and before the password: a token that does not
pass is 400 Bad Request with
The human check did not pass. Complete it again, then resubmit., and the
link keeps working.
Ask for a new link
POST /api/v1/users/verify-email/resend/ takes an email and the
human check’s turnstile_token, and mails a
new link to the address if an account that is not verified yet uses it. The
new link replaces the old ones and works for 24 hours.
import httpx
httpx.post( "http://localhost:8731/api/v1/users/verify-email/resend/", json={"email": "you@example.com", "turnstile_token": "the-token-from-the-widget"},)curl -X POST http://localhost:8731/api/v1/users/verify-email/resend/ \ -H "Content-Type: application/json" \ -d '{"email": "you@example.com", "turnstile_token": "the-token-from-the-widget"}'await fetch("http://localhost:8731/api/v1/users/verify-email/resend/", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email: "you@example.com", turnstile_token: "the-token-from-the-widget" }),});It always answers 202 Accepted with the same body, whether or not an
account uses the address and whether or not it is verified, so it never
tells anyone who is registered:
{ "detail": "If an unverified account uses this address, a new verification link is on its way."}The address is matched in its stored form, so
You@Example.COM asks for you@example.com’s link. A string that is not an
email address is a 422. Asking is
rate limited per client address
and per email address: over the limit you get 429 Too Many Requests with a
Retry-After header, the same answer for every address. A human-check token
that does not pass is 400 Bad Request, again the same for every address, and
mails nothing.
Signing in before you verify
Log in checks the password first. Only when the password is
right and the email is not verified does it answer 403 Forbidden with
exactly this detail:
{ "detail": "Email address not verified. Open the link we emailed you, or ask for a new one."}A client branches on that answer (403 from POST /api/v1/token/login/
means only this) to offer “send me a new link”. A wrong password is still
400 Bad Request, so the 403 tells nothing to someone who does not know
the password.
The MCP consent page shows the same text after its sign-in, with a
button that mails a new link, and gives the agent no authorization code until
the address is verified. Its “Create a new account” form, like
POST /api/v1/users/, mints nothing: it says the account was created and the
link is on its way; open it, then sign in on the consent page.
A registration that was never verified
An address is not held forever by an account that never verified it. If an account is still unverified 24 hours after it registered, registering the same address again replaces it: the old account, its link and any token it held are gone, and the new one is mailed a link of its own. Until then, registering the address again is refused as a duplicate, as it is for a verified account. An account the operator gave something to (an entitlement, say), one that already has a player, and one the operator deactivated are never replaced.
So if you registered with a password you have since forgotten, and never verified, register again after a day.
Changing your email
There is no way to change an account’s email address: it is set when you register.