mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2026-02-19 02:41:31 +00:00
try add oidc
This commit is contained in:
@@ -196,6 +196,11 @@ func (us *UserService) InfoByGoogleEmail(email string) *model.User {
|
||||
return us.InfoByOauthId(model.OauthTypeGithub, email)
|
||||
}
|
||||
|
||||
// InfoByOidcSub 根据oidc取用户信息
|
||||
func (us *UserService) InfoByOidcSub(sub string) *model.User {
|
||||
return us.InfoByOauthId(model.OauthTypeOidc, sub)
|
||||
}
|
||||
|
||||
// InfoByOauthId 根据oauth取用户信息
|
||||
func (us *UserService) InfoByOauthId(thirdType, uid string) *model.User {
|
||||
ut := AllService.OauthService.UserThirdInfo(thirdType, uid)
|
||||
@@ -219,6 +224,11 @@ 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)
|
||||
}
|
||||
|
||||
// RegisterByOauth 注册
|
||||
func (us *UserService) RegisterByOauth(thirdType, thirdName, uid string) *model.User {
|
||||
tx := global.DB.Begin()
|
||||
|
||||
Reference in New Issue
Block a user