|
|
@@ -277,7 +277,7 @@ func (o *Oauth) OauthCallback(c *gin.Context) {
|
|
277
|
277
|
return
|
|
278
|
278
|
}
|
|
279
|
279
|
//绑定, user preffered_username as username
|
|
280
|
|
- err = service.AllService.OauthService.BindOidcUser(userData.Sub, userData.PrefferedUsername, v.UserId)
|
|
|
280
|
+ err = service.AllService.OauthService.BindOidcUser(userData.Sub, userData.PreferredUsername, v.UserId)
|
|
281
|
281
|
if err != nil {
|
|
282
|
282
|
c.String(http.StatusInternalServerError, response.TranslateMsg(c, "BindFail"))
|
|
283
|
283
|
return
|
|
|
@@ -295,7 +295,7 @@ func (o *Oauth) OauthCallback(c *gin.Context) {
|
|
295
|
295
|
if !*oa.AutoRegister {
|
|
296
|
296
|
//c.String(http.StatusInternalServerError, "还未绑定用户,请先绑定")
|
|
297
|
297
|
|
|
298
|
|
- v.ThirdName = userData.PrefferedUsername
|
|
|
298
|
+ v.ThirdName = userData.PreferredUsername
|
|
299
|
299
|
v.ThirdOpenId = userData.Sub
|
|
300
|
300
|
url := global.Config.Rustdesk.ApiServer + "/_admin/#/oauth/bind/" + cacheKey
|
|
301
|
301
|
c.Redirect(http.StatusFound, url)
|
|
|
@@ -303,7 +303,7 @@ func (o *Oauth) OauthCallback(c *gin.Context) {
|
|
303
|
303
|
}
|
|
304
|
304
|
|
|
305
|
305
|
//自动注册
|
|
306
|
|
- u = service.AllService.UserService.RegisterByOidc(userData.PrefferedUsername, userData.Sub)
|
|
|
306
|
+ u = service.AllService.UserService.RegisterByOidc(userData.PreferredUsername, userData.Sub)
|
|
307
|
307
|
if u.Id == 0 {
|
|
308
|
308
|
c.String(http.StatusInternalServerError, response.TranslateMsg(c, "OauthRegisterFailed"))
|
|
309
|
309
|
return
|