diff options
Diffstat (limited to 'routers/web/user/auth.go')
-rw-r--r-- | routers/web/user/auth.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/user/auth.go b/routers/web/user/auth.go index 99885e5ce3..21d48e9834 100644 --- a/routers/web/user/auth.go +++ b/routers/web/user/auth.go @@ -789,7 +789,7 @@ func handleOAuth2SignIn(ctx *context.Context, source *login.Source, u *models.Us func oAuth2UserLoginCallback(loginSource *login.Source, request *http.Request, response http.ResponseWriter) (*models.User, goth.User, error) { gothUser, err := loginSource.Cfg.(*oauth2.Source).Callback(request, response) if err != nil { - if err.Error() == "securecookie: the value is too long" { + if err.Error() == "securecookie: the value is too long" || strings.Contains(err.Error(), "Data too long") { log.Error("OAuth2 Provider %s returned too long a token. Current max: %d. Either increase the [OAuth2] MAX_TOKEN_LENGTH or reduce the information returned from the OAuth2 provider", loginSource.Name, setting.OAuth2.MaxTokenLength) err = fmt.Errorf("OAuth2 Provider %s returned too long a token. Current max: %d. Either increase the [OAuth2] MAX_TOKEN_LENGTH or reduce the information returned from the OAuth2 provider", loginSource.Name, setting.OAuth2.MaxTokenLength) } |