mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 14:26:07 +08:00
增加重置密码命令
This commit is contained in:
parent
af3e358a6a
commit
bae4073a64
|
@ -384,6 +384,7 @@ export default (app: Router) => {
|
|||
body: Joi.object({
|
||||
retries: Joi.number().optional(),
|
||||
twoFactorActivated: Joi.boolean().optional(),
|
||||
password: Joi.string().optional(),
|
||||
}),
|
||||
}),
|
||||
async (req: Request, res: Response, next: NextFunction) => {
|
||||
|
|
|
@ -347,11 +347,12 @@ export default class UserService {
|
|||
}
|
||||
|
||||
public async resetAuthInfo(info: Partial<AuthInfo>) {
|
||||
const { retries, twoFactorActivated } = info;
|
||||
const { retries, twoFactorActivated, password } = info;
|
||||
const authInfo = await this.getAuthInfo();
|
||||
await this.updateAuthInfo(authInfo, {
|
||||
retries,
|
||||
twoFactorActivated,
|
||||
password,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user