Skip to content

Commit b1e452d

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 go-gitea#16096 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 73c03f5 commit b1e452d

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

models/oauth2.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@ func initOAuth2LoginSources() error {
155155
err := oauth2.RegisterProvider(source.Name, oAuth2Config.Provider, oAuth2Config.ClientID, oAuth2Config.ClientSecret, oAuth2Config.OpenIDConnectAutoDiscoveryURL, oAuth2Config.CustomURLMapping)
156156
if err != nil {
157157
log.Critical("Unable to register source: %s due to Error: %v. This source will be disabled.", source.Name, err)
158-
source.IsActived = false
159-
if err = UpdateSource(source); err != nil {
160-
log.Critical("Unable to update source %s to disable it. Error: %v", err)
161-
return err
162-
}
163158
}
164159
}
165160
return nil

0 commit comments

Comments
 (0)