feat(auth): Implement caching for scanauth
This commit is contained in:
@@ -80,9 +80,8 @@ export class ScanController {
|
||||
@ResponseSchema(RunnerNotFoundError, { statusCode: 404 })
|
||||
@OpenAPI({ description: 'Create a new track scan (for "normal" scans use /scans instead). <br> Please remember that to provide the scan\'s card\'s station\'s id.', security: [{ "StationApiToken": [] }, { "AuthToken": [] }, { "RefreshTokenCookie": [] }] })
|
||||
async postTrackScans(@Body({ validate: true }) createScan: CreateTrackScan, @Req() req: Request) {
|
||||
const station_id = req.headers["station_id"];
|
||||
if (station_id) {
|
||||
createScan.station = parseInt(station_id.toString());
|
||||
if (req.isStationAuth) {
|
||||
createScan.station = req.stationId;
|
||||
}
|
||||
let scan = await createScan.toEntity();
|
||||
scan = await this.trackScanRepository.save(scan);
|
||||
|
||||
Reference in New Issue
Block a user