Skip to content

Commit da50ede

Browse files
committed
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]>
1 parent 8d4d27f commit da50ede

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

services/auth/source/oauth2/init.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,7 @@ func initOAuth2LoginSources() error {
8181
}
8282
err := oauth2Source.RegisterSource()
8383
if err != nil {
84-
log.Critical("Unable to register source: %s due to Error: %v. This source will be disabled.", source.Name, err)
85-
source.IsActive = false
86-
if err = models.UpdateSource(source); err != nil {
87-
log.Critical("Unable to update source %s to disable it. Error: %v", err)
88-
return err
89-
}
84+
log.Critical("Unable to register source: %s due to Error: %v.", source.Name, err)
9085
}
9186
}
9287
return nil

0 commit comments

Comments
 (0)