feat: skip username restriction for new users coming from OAuth providers. (#1225)

This commit is contained in:
Gucheng
2022-10-17 18:01:01 +08:00
committed by GitHub
parent 50a52de856
commit 146aec9ee8
3 changed files with 9 additions and 16 deletions

View File

@ -411,12 +411,6 @@ func (c *ApiController) Login() {
// sync info from 3rd-party if possible
object.SetUserOAuthProperties(organization, user, provider.Type, userInfo)
msg := object.CheckUsername(user.Name)
if msg != "" {
c.ResponseError(msg)
return
}
affected := object.AddUser(user)
if !affected {
c.ResponseError(fmt.Sprintf("Failed to create user, user information is invalid: %s", util.StructToJson(user)))