Skip to content

Redirect to the only oAuth2 provider when other login methods are disabled#36901

Open
navneet102 wants to merge 2 commits intogo-gitea:mainfrom
navneet102:redirect-to-only-login-provider
Open

Redirect to the only oAuth2 provider when other login methods are disabled#36901
navneet102 wants to merge 2 commits intogo-gitea:mainfrom
navneet102:redirect-to-only-login-provider

Conversation

@navneet102
Copy link

Fixes: #36846

  • This PR makes the /login route redirect to the oAuth2 provider without rendering the login page if other login methods are disabled in the configuration.

  • Added skipAutoLogin URL param to bypass this feature by including ?skipAutoLogin=true

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 14, 2026
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 14, 2026
@navneet102 navneet102 marked this pull request as draft March 14, 2026 11:32
@wxiaoguang
Copy link
Contributor

  • Added skipAutoLogin URL param to bypass this feature by including ?skipAutoLogin=true

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.

@navneet102
Copy link
Author

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?

  1. Document it.
  2. Remove it.

@navneet102 navneet102 marked this pull request as ready for review March 14, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If there is just 1 login provider configured, redirect to it

3 participants