Citizen registration now returns tokens

ref #112
This commit is contained in:
Nicolai Ort 2021-01-21 19:17:40 +01:00
parent 0c87906cc3
commit 9dd9304a71
1 changed files with 4 additions and 2 deletions

View File

@ -46,7 +46,9 @@ export class RunnerSelfServiceController {
let runner = await createRunner.toEntity();
runner = await this.runnerRepository.save(runner);
return new ResponseSelfServiceRunner(await this.runnerRepository.findOne(runner, { relations: ['scans', 'group', 'scans.track', 'cards', 'distanceDonations', 'distanceDonations.donor', 'distanceDonations.runner', 'distanceDonations.runner.scans', 'distanceDonations.runner.scans.track'] }));
let response = new ResponseSelfServiceRunner(await this.runnerRepository.findOne(runner, { relations: ['scans', 'group', 'scans.track', 'cards', 'distanceDonations', 'distanceDonations.donor', 'distanceDonations.runner', 'distanceDonations.runner.scans', 'distanceDonations.runner.scans.track'] }));
response.token = JwtCreator.createSelfService(runner);
return response;
}
@Post('/register/:token')
@ -61,7 +63,7 @@ export class RunnerSelfServiceController {
let response = new ResponseSelfServiceRunner(await this.runnerRepository.findOne(runner, { relations: ['scans', 'group', 'scans.track', 'cards', 'distanceDonations', 'distanceDonations.donor', 'distanceDonations.runner', 'distanceDonations.runner.scans', 'distanceDonations.runner.scans.track'] }));
response.token = JwtCreator.createSelfService(runner);
return response
return response;
}
/**