Closed JhonatanPatrocinio closed 2 years ago
hi @JhonatanPatrocinio, this example from the readme is fitting:
//authenticate() example
Route.get('/dashboard', async ({ auth }) => {
await auth.use("jwt").authenticate();
const userPayload = auth.use("jwt").user!;
});
userPayload
is the payload you used to generate the JWT
I try this and userPayload is equal to User instance
You're right. Let me check
https://github.com/maxgalbu/adonis5-jwt/commit/823cf95c72b92f0182f4e896b1422ebff7e890f6 added payload
to the guard, see the readme for docs
I've also published 1.0.9 with that commit
await auth.use("jwt").generate(user, { payload: { is_verified: true, }, });
how can I obtain this payload on the middleware?