mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Use UserInfo's ID in OAuth login
This commit is contained in:
parent
775dd9eb57
commit
111d1a5786
@ -615,11 +615,16 @@ func (c *ApiController) Login() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userId := userInfo.Id
|
||||||
|
if userId == "" {
|
||||||
|
userId = util.GenerateId()
|
||||||
|
}
|
||||||
|
|
||||||
user = &object.User{
|
user = &object.User{
|
||||||
Owner: application.Organization,
|
Owner: application.Organization,
|
||||||
Name: userInfo.Username,
|
Name: userInfo.Username,
|
||||||
CreatedTime: util.GetCurrentTime(),
|
CreatedTime: util.GetCurrentTime(),
|
||||||
Id: util.GenerateId(),
|
Id: userId,
|
||||||
Type: "normal-user",
|
Type: "normal-user",
|
||||||
DisplayName: userInfo.DisplayName,
|
DisplayName: userInfo.DisplayName,
|
||||||
Avatar: userInfo.AvatarUrl,
|
Avatar: userInfo.AvatarUrl,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user