POST /auth/verify-email
Confirma um token de verificação, marca o e-mail como verificado e emite sessão nova (auto-login pós confirmação).
- Access: Public
- Service:
https://auth-api.axuz.net
Accepted authentication
No authentication (public route, or protected by link/signature).
Confirma um token de verificação, marca o e-mail como verificado e emite sessão nova (auto-login pós confirmação).
Motivo: fechar o loop signup → e-mail → clique. Auto-login evita obrigar o user a digitar senha depois do clique — reduz drop-off no funil de ativação. Comportamento: (1) decoda body {token}; 400 body inválido ou token vazio; (2) rate-limit verify-email:<ip> 10/hora com Retry-After; (3) sha256Hex(token) — DB só guarda hash; (4) FindEmailVerification — ErrNoRows = 400 opaco (evita enumeration de tokens válidos); outros erros = 500; (5) 410 Gone se ConsumedAt != nil (replay) ou ExpiresAt no passado; (6) ConsumeEmailVerification — marca consumed_at + users.email_verified atômico; (7) busca user; (8) writeSession emite cookies e persiste refresh; (9) 200 payload {verified:true, user{id,email,name}}.
Entradas: body JSON {token}; IP client pra rate-limit.
Retorno: 200 + cookies; 400 body/token inválido; 410 já usado/expirado; 429 rate-limit; 500 falha interna.
Parameters
No parameters.
Request body
Corpo JSON. O schema detalhado deste endpoint ainda não está tipado na spec; veja a descrição da operação.
application/json
| Name | Type | Required | Description |
|---|---|---|---|
(corpo) | object | no |
{}Responses
200
+ cookies
400
Body/token inválido
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
410
Já usado/expirado
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Falha interna
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
Examples
"Try it" is turned off in this reference. Use the examples with your test credential.
curl
curl -sS -X POST 'https://auth-api.axuz.net/auth/verify-email' \
-H "Content-Type: application/json" \
-d '{}'Node.js
const res = await fetch("https://auth-api.axuz.net/auth/verify-email", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());Python
import os
import requests
res = requests.request(
"POST",
"https://auth-api.axuz.net/auth/verify-email",
json={},
timeout=30,
)
res.raise_for_status()
print(res.json())