Redirect to the only oAuth2 provider when other login methods are disabled#36901
Redirect to the only oAuth2 provider when other login methods are disabled#36901navneet102 wants to merge 4 commits intogo-gitea:mainfrom
Conversation
What will it be used for? Who will use it? Any real world use case for it? If it is not used by our code, not clearly documented for real world use cases, then it doesn't make sense. |
|
I included it because it was mentioned in this comment, it could be used if auth source is unavailable. What do you suggest, should I?
|
|
@wxiaoguang I have added some tests. Could you check this now please? |
I don't understand it |
|
Sorry for being vague.
I think you asked here about why I included the In the reply, I mentioned that it was a design choice specified by @silverwind while accepting the feature proposal in this issue's (#36846 ) discussion.
Here I asked you, if I should remove the |
As I said, I don't understand it. You are the author so you need to propose reasonable and feasible designs. |
|
You can explain your design by answering the questions:
|
Fixes: #36846
Summary
/loginroute is accessed if other login methods are disabled in the configurationskipAutoLoginURL parameter to bypass the auto-redirect feature by using?skipAutoLogin=trueescape hatch (useful when the auth source is temporarily unavailable)Changes
routers/web/auth/auth.goperformAutoLoginOAuth2to handle redirection and updatedSignInto trigger it when password, OpenID, Passkey, and SSPI login methods are disabled.routers/web/auth/auth_test.goSignInAutoRedirectSingleProviderunit test to verify automatic redirection and theskipAutoLoginbypass.Test plan
/login?skipAutoLogin=truebypasses the redirect?redirect_to=happens after authenticationAssisted by Claude Code