mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
chore: oidc自动注册时增加邮箱
This commit is contained in:
@@ -172,6 +172,7 @@ export class ConnectController extends BaseController {
|
||||
newUser.username = `${userInfo.nickName}_${simpleNanoId(6)}_${oauthType}`;
|
||||
newUser.avatar = userInfo.avatar;
|
||||
newUser.nickName = userInfo.nickName || simpleNanoId(6);
|
||||
newUser.email = userInfo.email || "";
|
||||
|
||||
newUser = await this.userService.register("username", newUser, async (txManager) => {
|
||||
const oauthBound: OauthBoundEntity = new OauthBoundEntity()
|
||||
|
||||
@@ -129,6 +129,7 @@ export class OidcOauthProvider extends BaseAddon implements IOauthProvider {
|
||||
openId: claims.sub,
|
||||
nickName: claims.nickname || claims.name || claims.username || claims.preferred_username || "",
|
||||
avatar: claims.picture,
|
||||
email: claims.email || "",
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user