-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LANDING_PAGE=login leads to endless redirects if you're logged in #28231
Comments
I can reproduce this issue in 1.21.But I can not reproduce this in the latest version. So it seems that it was fixed. ps: Maybe it was fixed by #27606. |
Hey @yp05327 |
Oh, no, 1.21.2 still has it. |
I have just upgraded to v1.21.3 and I'm also experiencing this issue. |
It should probably be a good idea to allow two landing page values one for unauthorized and one for authorized users, ex. |
It is a bug, and I think it is related to the auth token ( Enhanced auth token / remember me #27606 ) I guess it's also somewhat related to False alarm warning message for invalid auth token #28602 For this issue, these are the steps to reproduce:
And 1.22 is also affected. |
@KN4CK3R would you like to take a look? |
That behaviour is unrelated to #27606. We just have a check in gitea/routers/web/auth/auth.go Lines 129 to 150 in 4d1277c
129 checks for an existing login 148 redirects to /user/login again
I don't know how useful it is to set the login page as landing page. If you want to force a login you can set |
For example, you don't want to show the default landing page, the login page looks like the most relevant and convenient. REQUIRE_SIGNIN_VIEW isn't what you want since it simply closes everything, all public projects, exploring, etc. You still want to allow this. |
-> Avoid cycle-redirecting user/login page #28636 |
For the reference, this issue is introduced during change from #26105. Before the change, the signed-in user may go to home page before touch real sign-in logic. |
Fix #28231, and remove some unused code. The `db.HasEngine` doesn't seem useful because the db engine is always initialized before web route.
Thanks guys! Good luck to you all! |
Fix go-gitea#28231, and remove some unused code. The `db.HasEngine` doesn't seem useful because the db engine is always initialized before web route.
Fix go-gitea#28231, and remove some unused code. The `db.HasEngine` doesn't seem useful because the db engine is always initialized before web route.
Description
Hi!
When you use
LANDING_PAGE = login
, you get endless redirects of/user/login
page if you're logged in. The/user/login
page always makes endless redirects, whereas the home (/
) page does this as well, but from time to time (probably this is session-related or something like that).Regarding home page: it works OK usually, but if you do not use Gitea for some time (not so much, you're still logged in), it will trigger endless redirects until you open the home page again.
Additional info:
Gitea versions: 1.21.0, 1.21.1
I'm using Gitea behind Caddy with the simplest configuration:
Gitea Version
1.21.1
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
I'm running Gitea from Docker:
gitea/gitea:1.21.1
Database
SQLite
The text was updated successfully, but these errors were encountered: