move to 15min limit
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
41c4ed4d0f
commit
edaf255e8f
|
@ -119,7 +119,7 @@ export class RunnerSelfServiceController {
|
|||
@Post('/runners/login')
|
||||
@ResponseSchema(RunnerNotFoundError, { statusCode: 404 })
|
||||
@OnUndefined(ResponseEmpty)
|
||||
@OpenAPI({ description: 'Use this endpoint to reuqest a new selfservice magic-login-link to be sent to your mail address (rate limited to one mail every 24hrs).' })
|
||||
@OpenAPI({ description: 'Use this endpoint to reuqest a new selfservice magic-login-link to be sent to your mail address (rate limited to one mail every 15mins).' })
|
||||
async requestNewToken(@QueryParam('mail') mail: string, @QueryParam("locale") locale: string = "en") {
|
||||
if (!mail) {
|
||||
throw new RunnerNotFoundError();
|
||||
|
@ -127,7 +127,7 @@ export class RunnerSelfServiceController {
|
|||
const runner = await this.runnerRepository.findOne({ email: mail });
|
||||
if (!runner) { throw new RunnerNotFoundError(); }
|
||||
|
||||
if (runner.resetRequestedTimestamp > (Math.floor(Date.now() / 1000) - 60 * 60 * 24)) { throw new RunnerSelfserviceTimeoutError(); }
|
||||
if (runner.resetRequestedTimestamp > (Math.floor(Date.now() / 1000) - 60 * 15)) { throw new RunnerSelfserviceTimeoutError(); }
|
||||
const token = JwtCreator.createSelfService(runner);
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue