This commit is contained in:
parent
41c4ed4d0f
commit
edaf255e8f
@ -119,7 +119,7 @@ export class RunnerSelfServiceController {
|
|||||||
@Post('/runners/login')
|
@Post('/runners/login')
|
||||||
@ResponseSchema(RunnerNotFoundError, { statusCode: 404 })
|
@ResponseSchema(RunnerNotFoundError, { statusCode: 404 })
|
||||||
@OnUndefined(ResponseEmpty)
|
@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") {
|
async requestNewToken(@QueryParam('mail') mail: string, @QueryParam("locale") locale: string = "en") {
|
||||||
if (!mail) {
|
if (!mail) {
|
||||||
throw new RunnerNotFoundError();
|
throw new RunnerNotFoundError();
|
||||||
@ -127,7 +127,7 @@ export class RunnerSelfServiceController {
|
|||||||
const runner = await this.runnerRepository.findOne({ email: mail });
|
const runner = await this.runnerRepository.findOne({ email: mail });
|
||||||
if (!runner) { throw new RunnerNotFoundError(); }
|
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);
|
const token = JwtCreator.createSelfService(runner);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user