Skip to content

Commit

Permalink
Reattempt oauth2 registration on login if registration failed
Browse files Browse the repository at this point in the history
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 <art27@cantab.net>
  • Loading branch information
zeripath committed Jul 28, 2021
1 parent 8d4d27f commit da50ede
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions services/auth/source/oauth2/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,7 @@ func initOAuth2LoginSources() error {
}
err := oauth2Source.RegisterSource()
if err != nil {
log.Critical("Unable to register source: %s due to Error: %v. This source will be disabled.", source.Name, err)
source.IsActive = false
if err = models.UpdateSource(source); err != nil {
log.Critical("Unable to update source %s to disable it. Error: %v", err)
return err
}
log.Critical("Unable to register source: %s due to Error: %v.", source.Name, err)
}
}
return nil
Expand Down

0 comments on commit da50ede

Please sign in to comment.