I’ve enabled magic auth in my Repl. I’m currently using a pre-built page for login. I’m trying to access the X-Replit-User-Name header.
X-Replit-User-Name returns the username of the person
X-Replit-User-Name returns an empty string
Steps to reproduce:
Create a simple web server, and enable magic auth. Access the request header X-Replit-User-Name.
Could you post a link to your Repl? It may help the community with this issue as I don’t believe it is a bug since I’ve recently been using Repl auth to authenticate users and had no issues.
Update – I’ve checked using google chrome, and it was working. It seems to be a Microsoft Edge specific problem.
It’s probably not possible for you to debug my Repl on your end as this is a server-side issue. The Repl is also private.
Could you create another Repl replicating the issue without anything you need to keep private?
it does return an empty string if the user isn’t logged in on your repl. Maybe this is because of some strict tracking prevention settings/extensions on the browser. Does it still not work on Edge? It does usually for me
If the user has logged in, the headers will be created, but they will eventually expire, at which point the headers may remain, but without any content. Correct?