mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
增加重置密码命令
This commit is contained in:
parent
af3e358a6a
commit
bae4073a64
|
@ -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) => {
|
||||||
|
|
|
@ -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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user