GET /auth/me
Devolve o perfil do usuário autenticado + times + role de plataforma pra hidratar o app após F5 ou navegar entre subdomínios.
- Access: Signed in (incl. pre-session)
- Service:
https://auth-api.axuz.net
Accepted authentication
sessionCookie— Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.bearerSession— JWT de acesso da sessão em `Authorization: Bearer`.
Devolve o perfil do usuário autenticado + times + role de plataforma pra hidratar o app após F5 ou navegar entre subdomínios.
Motivo: fonte única do estado logado consumida por todos os clients Next (workspace, hub, backoffice, admin) na hidratação inicial. Sem isso cada client teria que ler cookies e adivinhar teams. Comportamento: (1) resolve user_id via authUserIDFromRequest (cookie → bearer → X-User-ID); 401 se falhar; (2) busca user por ID, 404 se ausente; (3) FindPlatformRole (owner/admin da plataforma → gate do backoffice); (4) ListUserTeamsWithRoles — nil em erro vira slice vazio pra não quebrar client; (5) responde 200 com {id, email, name, is_platform_admin, platform_role, teams}.
Entradas: cookie access_token (ou bearer/X-User-ID).
Retorno: 200 payload; 401 sem/invalid token; 404 user sumiu.
Parameters
No parameters.
Responses
200
Payload
401
Sem credencial valida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
404
User sumiu
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| 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 GET 'https://auth-api.axuz.net/auth/me' \
-H "Authorization: Bearer $AXUZ_TOKEN"Node.js
const res = await fetch("https://auth-api.axuz.net/auth/me", {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
},
});
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(
"GET",
"https://auth-api.axuz.net/auth/me",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())