Skip to content

Commit

Permalink
Add /user/login?noredirect=true, skipping forced login through OAuth2…
Browse files Browse the repository at this point in the history
…/OpenID
  • Loading branch information
brechtvl committed Jan 30, 2023
1 parent d6cddbd commit 979a48c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2740,7 +2740,7 @@ auths.oauth2_emailURL = Email URL
auths.skip_local_two_fa = Skip local 2FA
auths.skip_local_two_fa_helper = Leaving unset means local users with 2FA set will still have to pass 2FA to log on
auths.force_o_auth = Force login via this authentication
auths.force_o_auth_helper = Set this to automatically redirect sign in to this OAuth provider
auths.force_o_auth_helper = Set this to automatically redirect sign in to this OAuth provider (unless ?noredirect=true is set)
auths.oauth2_tenant = Tenant
auths.oauth2_scopes = Additional Scopes
auths.oauth2_required_claim_name = Required Claim Name
Expand Down
3 changes: 3 additions & 0 deletions routers/web/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ func checkAutoLogin(ctx *context.Context) bool {

func checkForceOAuth(ctx *context.Context) bool {
// Check if authentication is forced to OAuth
if ctx.FormBool("noredirect") {
return false
}

authSources, err := auth.GetActiveOAuth2ProviderSources()
if err != nil {
Expand Down

0 comments on commit 979a48c

Please sign in to comment.