增加重置密码命令

This commit is contained in:
whyour 2025-02-27 23:57:26 +08:00
parent af3e358a6a
commit bae4073a64
2 changed files with 3 additions and 1 deletions

View File

@ -384,6 +384,7 @@ export default (app: Router) => {
body: Joi.object({ body: Joi.object({
retries: Joi.number().optional(), retries: Joi.number().optional(),
twoFactorActivated: Joi.boolean().optional(), twoFactorActivated: Joi.boolean().optional(),
password: Joi.string().optional(),
}), }),
}), }),
async (req: Request, res: Response, next: NextFunction) => { async (req: Request, res: Response, next: NextFunction) => {

View File

@ -347,11 +347,12 @@ export default class UserService {
} }
public async resetAuthInfo(info: Partial<AuthInfo>) { public async resetAuthInfo(info: Partial<AuthInfo>) {
const { retries, twoFactorActivated } = info; const { retries, twoFactorActivated, password } = info;
const authInfo = await this.getAuthInfo(); const authInfo = await this.getAuthInfo();
await this.updateAuthInfo(authInfo, { await this.updateAuthInfo(authInfo, {
retries, retries,
twoFactorActivated, twoFactorActivated,
password,
}); });
} }
} }