mirror of
https://github.com/certd/certd.git
synced 2026-06-24 11:17:30 +08:00
fix: 修复clogin登录丢失state问题
This commit is contained in:
@@ -184,9 +184,9 @@ export class UserService extends BaseService<UserEntity> {
|
||||
}
|
||||
|
||||
async register(type: string, user: UserEntity, withTx?: (tx: EntityManager) => Promise<void>) {
|
||||
if (!user.password) {
|
||||
user.password = simpleNanoId();
|
||||
}
|
||||
// if (!user.password) {
|
||||
// user.password = simpleNanoId();
|
||||
// }
|
||||
|
||||
if (user.username) {
|
||||
const username = user.username;
|
||||
@@ -229,9 +229,11 @@ export class UserService extends BaseService<UserEntity> {
|
||||
passwordVersion: 2,
|
||||
});
|
||||
if (!newUser.password) {
|
||||
newUser.password = RandomUtil.randomStr(6);
|
||||
newUser.password = "changeme";
|
||||
}else{
|
||||
newUser.password = await this.genPassword(newUser.password, newUser.passwordVersion);
|
||||
}
|
||||
newUser.password = await this.genPassword(newUser.password, newUser.passwordVersion);
|
||||
|
||||
|
||||
await this.transaction(async txManager => {
|
||||
newUser = await txManager.save(newUser);
|
||||
|
||||
Reference in New Issue
Block a user