Add providerItem.SignupGroup

This commit is contained in:
Yang Luo
2023-10-20 23:10:43 +08:00
parent 96cbf51ca0
commit 98defe617b
5 changed files with 37 additions and 10 deletions

View File

@ -651,6 +651,15 @@ func (c *ApiController) Login() {
c.ResponseError(fmt.Sprintf(c.T("auth:Failed to create user, user information is invalid: %s"), util.StructToJson(user)))
return
}
if providerItem.SignupGroup != "" {
user.Groups = []string{providerItem.SignupGroup}
_, err = object.UpdateUser(user.GetId(), user, []string{"groups"}, false)
if err != nil {
c.ResponseError(err.Error())
return
}
}
}
// sync info from 3rd-party if possible