diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 02f988c05c..48c14f4636 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -389,7 +389,7 @@ func getUserName(gothUser *goth.User) (string, error) { switch setting.OAuth2Client.Username { case setting.OAuth2UsernamePreferredUsername: username := gothUser.RawData["preferred_username"].(string) - if strings.containsAny(username, "@") { + if strings.Contains(username, "@") { return user_model.NormalizeUserName(strings.Split(username, "@")[0]) } return user_model.NormalizeUserName(username)