0

I'm new to adonis js while implementing authentication and authorization the authorization middleware fails even when I'm passing bearer and token gotten from login endpoint.

I logged my postman request in Auth middleware

{
  authorization: 'Bearer W29iamVjdCBPYmplY3Rd.FIw11Mk9dwtd5NOL8KwepObWYWHLY9iw5mgoH82W9gd0J1GqECAL2jg1X9t5',
  accept: 'application/json',
  'user-agent': 'PostmanRuntime/7.29.3',
  'postman-token': '69fbbf2a-035f-4150-a1cd-96c70c299818',
  host: '127.0.0.1:3333',
  'accept-encoding': 'gzip, deflate, br',
  connection: 'keep-alive'
}

But the response i get is 401 error

"errors": [
        {
            "message": "E_UNAUTHORIZED_ACCESS: Unauthorized access"
        }
    ]

I don't know if I'm missing something else I need to do when authorizing with the token

Yhomi
  • 97
  • 1
  • 9

0 Answers0