fix: 修复用户删除后,用相同的oauth授权登录报错用户不存在的问题

https://github.com/certd/certd/issues/603
This commit is contained in:
xiaojunnuo
2025-12-19 11:37:22 +08:00
parent 31f09ab117
commit e505916525
2 changed files with 11 additions and 1 deletions
@@ -242,7 +242,9 @@ export class LoginService {
}
const info = await this.userService.findOne({id: oauthBound.userId});
if (info == null) {
throw new CommonException('用户不存在');
// 用户已被删除,删除此oauth绑定
await this.oauthBoundService.delete([oauthBound.id]);
return null
}
return this.generateToken(info);
}