Bearer Token Not Working? #3949
-
I'm new to Adonis, after several years of Laravel usage, and was trying to get a basic api authenticated route. But for some reason keep getting unauthorized access? // post /login
const token = await auth.use('api').attempt(email, password, {
expiresIn: '10 days'
})
return token
// all is good, i can get the token // routes.ts
Route.group(() => {
Route.get('/all', 'ArticlesController.all')
}).prefix('api/v1/articles').middleware('auth'); Making a get request via Insomnia with Authorization: Bearer (Token) always returns "E_UNAUTHORIZED_ACCESS: Unauthorized access" PS: I've seen screenshots with "pretty" error screen pages... is there any setting to enable those or is it some package? |
Beta Was this translation helpful? Give feedback.
Answered by
thetutlage
Oct 26, 2022
Replies: 1 comment 3 replies
-
Can you share the headers Insomnia is sending? |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
RomainLanz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you share the headers Insomnia is sending?