diff options
Diffstat (limited to 'models/oauth2.go')
-rw-r--r-- | models/oauth2.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/models/oauth2.go b/models/oauth2.go index a1917540d0..0640471a48 100644 --- a/models/oauth2.go +++ b/models/oauth2.go @@ -97,14 +97,17 @@ func GetActiveOAuth2Providers() ([]string, map[string]OAuth2Provider, error) { } // InitOAuth2 initialize the OAuth2 lib and register all active OAuth2 providers in the library -func InitOAuth2() { - oauth2.Init() +func InitOAuth2() error { + if err := oauth2.Init(x); err != nil { + return err + } loginSources, _ := GetActiveOAuth2ProviderLoginSources() for _, source := range loginSources { oAuth2Config := source.OAuth2() oauth2.RegisterProvider(source.Name, oAuth2Config.Provider, oAuth2Config.ClientID, oAuth2Config.ClientSecret, oAuth2Config.OpenIDConnectAutoDiscoveryURL, oAuth2Config.CustomURLMapping) } + return nil } // wrapOpenIDConnectInitializeError is used to wrap the error but this cannot be done in modules/auth/oauth2 |