Admin panel 401 error

Just in case you haven’t solved it yet, I’ve had the exact same issue in AWS using a CloudFront setup in terraform with nginx in front of Strapi. Noticed that I was only forwarding along the Host header to requests, so the Authorization header got scrubbed from requests after registering the admin user.

To check if this is your issue, after registering an admin user check if your Authorization request header is ‘Bearer null’

Added ‘Authorization’ as a permitted header in my CloudFront distribution and now everything’s working.

2 Likes