mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
perf: 登录失败增加重试次数限制及冷却时间
This commit is contained in:
@@ -24,6 +24,20 @@ export class LoginController extends BaseController {
|
||||
return this.ok(token);
|
||||
}
|
||||
|
||||
@Post('/loginBySms', { summary: Constants.per.guest })
|
||||
public async loginBySms(
|
||||
@Body(ALL)
|
||||
body: any
|
||||
) {
|
||||
const token = await this.loginService.loginBySmsCode(body);
|
||||
|
||||
this.ctx.cookies.set('token', token.token, {
|
||||
maxAge: 1000 * token.expire,
|
||||
});
|
||||
|
||||
return this.ok(token);
|
||||
}
|
||||
|
||||
@Post('/logout', { summary: Constants.per.authOnly })
|
||||
public logout() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user