Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reattempt oauth2 registration on login if registration failed
If OAuth2 registration fails at startup we currently disable the
login_source however an alternative approach could be to reattempt
registration on login attempt.

Fix #16096

Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed Jul 28, 2021
commit b1e452d4a6a1e5944b133376cb32f7bb66ca4c0d
5 changes: 0 additions & 5 deletions models/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ func initOAuth2LoginSources() error {
err := oauth2.RegisterProvider(source.Name, oAuth2Config.Provider, oAuth2Config.ClientID, oAuth2Config.ClientSecret, oAuth2Config.OpenIDConnectAutoDiscoveryURL, oAuth2Config.CustomURLMapping)
if err != nil {
log.Critical("Unable to register source: %s due to Error: %v. This source will be disabled.", source.Name, err)
source.IsActived = false
if err = UpdateSource(source); err != nil {
log.Critical("Unable to update source %s to disable it. Error: %v", err)
return err
}
}
}
return nil
Expand Down