Login loop with first login. #120
Labels
No labels
bug
chore
documentation
enhancement
help
in-progress
question
ready-for-release
released
translation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
adam/gate#120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Have no idea why but I am going a login loop with first login, I run docker compose up and I see the database starting and configuring without error, then I see the frontend starting without error... auth_admin and its one time password are showing when I try to log into the frontend it just loops back to the login page without doing anything. and the "admin panel" is not shown. When I try a completely random login I get an error saying invalid username or password....so I am sure its doing something. when I try auth_admin with a random password I also get invalid username or password. I have tried firefox and edge and get the same.
When I look at the logs all i get is listening on port 3000.
Is there any way to enable verbose logging so that I can at least see what is happening when I login? if I look at the dev console in firefox and edge I get no errors related to login
not sure if this is the cause.... took the exact same docker compose file and run on an external VPS
the login loop is only on my homelab internal domain https://void.internal this one login loops (internal trusted cert)
The external VPS domain is https://void.*******.duckdns.org and that works fine. (Lets Encrypt Cert)
they are both behind a caddy server reverse proxy
Since it is looping for your internal domain only, my first thought is to make sure your APP_URL environment variable is set exactly how you reach it in the browser. It should include the protocol and have no trailing slash. I think in your case
APP_URL: https://void.internalMy second thought would be to check what the last redirect was from VoidAuth before you ended up back at login. You should be able to check in the Network tab for the last few entries with status 302 or 303, and see what the 'Location' headers are on those requests. Having those would help me figure out what is going wrong. I will attach a screenshot showing a successful login, let me know if you would like help with this debugging step:
If the last redirect is as shown in the screenshot,
https://voidauth.internal/api/cbtohttps://voidauth.internal/then the problem is something else.Though before doing any fancy debugging, try changing your voidauth version in your docker compose yaml to
:edgefrom:latest. I have done some work on redirects and APP_URL parsing that could possibly fix your issue. If that works please let me knowvoidauth/voidauth:edgeThanks for looking into this, I tried again last night and got a very weird result....I tried in firefox and got the same result, then with the dev console open I tried in edge and it worked....it let me login for the first time, so i change the password and saved, change the username and saved then I created a passkey and saved....I then logged out and tried to login again.. and everything failed, new password failed, passkey failed....I was back to exactly the same login loop....I then deleted all the config and db and tried again doing the exact same thing as before...login loop...This morning I tried the edge version and still get the same thing.
as you can see in the console view this is straight after a login....I get a bunch of 304...then it shows me in the console 401 error at the page https://void.internal/api/user/me.
The fact that is worked properly once really messes with my mind and it makes no sense as to why it would work once.
I am going to quickly build another fresh docker vm and try the same config on that...there might be something on unique to my old docker server that is causing a problem. I will let you know how it goes
I am now sure that this is pretty much a "me" problem and not something with your code....I have just build a new docker server on proxmox copied over the compose file as is, made no changes and it works as documented. I still cant get my head around why it would work once....but instead of spending days trying to figure it out just going to stay on new docker server. In fact I am inspired to move all my other containers over to the new server, nothing better then a clean start with docker. (my old docker host is about 7 years old with nothing but updates..! ). Thanks again for a great project and your help.
Nice! Glad you got it working, even though it is unknown why it wouldn't work on your original setup. I am going to close this, but if you run into anything feel free to open another issue
I am actually going through this currently and have nearly the same symptoms. It was working great and then it stopped.
If I use an incorrect password/username it tells me as such, but if I use a correct username/password it just drops me back at the login page.
I am running in kubernetes with the following deployment:
and the database is cnpg. Again, it was working fine until tonight when I tried to log into forgejo using VoidAuth and it just kept looping back to the login page.
In a moment of pulling myself out of the rabbit hole, I decided to try some other systems... and they all work just fine. So this is definitely a browser issue. I'll post back if I figure out what it was as I still think it was likely related to the initial issue.
edit: Looks like even though I cleared out the storage using the developer tools, there was another domain cookie somewhere that was mucking things up. after clearing out ALL of the cookies for my domain, it's back to normal.
I also encountered this problem, with the same 401 error from the same API. Strangely, only one computer had this issue; the other computer and phone worked perfectly. It might be related to cookies, but this hasn't been verified yet.