mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-11-29 08:33:21 +00:00
fix: spelling
This commit is contained in:
@@ -277,7 +277,7 @@ func (o *Oauth) OauthCallback(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
//绑定, user preffered_username as username
|
||||
err = service.AllService.OauthService.BindOidcUser(userData.Sub, userData.PrefferedUsername, v.UserId)
|
||||
err = service.AllService.OauthService.BindOidcUser(userData.Sub, userData.PreferredUsername, v.UserId)
|
||||
if err != nil {
|
||||
c.String(http.StatusInternalServerError, response.TranslateMsg(c, "BindFail"))
|
||||
return
|
||||
@@ -295,7 +295,7 @@ func (o *Oauth) OauthCallback(c *gin.Context) {
|
||||
if !*oa.AutoRegister {
|
||||
//c.String(http.StatusInternalServerError, "还未绑定用户,请先绑定")
|
||||
|
||||
v.ThirdName = userData.PrefferedUsername
|
||||
v.ThirdName = userData.PreferredUsername
|
||||
v.ThirdOpenId = userData.Sub
|
||||
url := global.Config.Rustdesk.ApiServer + "/_admin/#/oauth/bind/" + cacheKey
|
||||
c.Redirect(http.StatusFound, url)
|
||||
@@ -303,7 +303,7 @@ func (o *Oauth) OauthCallback(c *gin.Context) {
|
||||
}
|
||||
|
||||
//自动注册
|
||||
u = service.AllService.UserService.RegisterByOidc(userData.PrefferedUsername, userData.Sub)
|
||||
u = service.AllService.UserService.RegisterByOidc(userData.PreferredUsername, userData.Sub)
|
||||
if u.Id == 0 {
|
||||
c.String(http.StatusInternalServerError, response.TranslateMsg(c, "OauthRegisterFailed"))
|
||||
return
|
||||
|
||||
@@ -92,7 +92,7 @@ type OidcUserdata struct {
|
||||
Email string `json:"email"`
|
||||
VerifiedEmail bool `json:"email_verified"`
|
||||
Name string `json:"name"`
|
||||
PrefferedUsername string `json:"preffered_username"`
|
||||
PreferredUsername string `json:"preferred_username"`
|
||||
}
|
||||
|
||||
type OauthCacheItem struct {
|
||||
|
||||
@@ -224,9 +224,9 @@ func (us *UserService) RegisterByGoogle(name string, email string) *model.User {
|
||||
return us.RegisterByOauth(model.OauthTypeGoogle, name, email)
|
||||
}
|
||||
|
||||
// RegisterByOidc 注册, use prefferedUsername as username, sub as openid
|
||||
func (us *UserService) RegisterByOidc(prefferedUsername string, sub string) *model.User {
|
||||
return us.RegisterByOauth(model.OauthTypeOidc, prefferedUsername, sub)
|
||||
// RegisterByOidc 注册, use PreferredUsername as username, sub as openid
|
||||
func (us *UserService) RegisterByOidc(PreferredUsername string, sub string) *model.User {
|
||||
return us.RegisterByOauth(model.OauthTypeOidc, PreferredUsername, sub)
|
||||
}
|
||||
|
||||
// RegisterByOauth 注册
|
||||
|
||||
Reference in New Issue
Block a user