adonis jwt authentication how find the user without store it on the database #1464
-
I'm a little confused for know how adonis defined the user token while it's not store in the database. I have a controller like bellow class UserController {
async login({ auth, request }) {
const { email, password } = request.all()
return await auth.attempt(password, password)
}
} it return a currect jwt token but when I'm checking the because in some other routes I'm retrive the users data by token and it return the currect user |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
JWT tokens are self contained and not stored inside database at all. I suggest reading about JWTs in general. https://jwt.io/ |
Beta Was this translation helpful? Give feedback.
-
Hello First of all let explain some points about JWT Do we need to save our access Tokens ? therefore , some tech companies store access_tokens in a safe place so they can black list them at anytime even if they are active (login must apply in app level) . |
Beta Was this translation helpful? Give feedback.
JWT tokens are self contained and not stored inside database at all. I suggest reading about JWTs in general. https://jwt.io/