https://auth-jwt-test.herokuapp.com/auth
body {
...,
}
header {
expiresIn?: <number>,
time?: <number> (opcional)
}
{
user: {
...body,
createdAt: <Date>,
},
expiresIn: <number>,
token: <string>
}
https://auth-jwt-test.herokuapp.com/private
header {
Authorization: Bearer <token>,
id: <string>,
time?: <number> (opcional)
}
{
status: <string>
}
Rota | body | header |
---|---|---|
/auth | qualquer (obrigatório) | expiresIn: expiração do token (seg.) , time: Tempo de espera |
/private | Nenhum | Authorization: Bearer + <token> , id: retornado pela /auth , time: tempo de espera (seg.) |