Alpha Release 0.3.0 #122

Merged
niggl merged 42 commits from dev into main 2021-01-24 17:57:38 +00:00
Showing only changes of commit 6434b4dfce - Show all commits

View File

@ -3,7 +3,7 @@ import { Body, Get, JsonController, OnUndefined, Param, Post } from 'routing-con
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi'; import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
import { getConnectionManager, Repository } from 'typeorm'; import { getConnectionManager, Repository } from 'typeorm';
import { config } from '../config'; import { config } from '../config';
import { InvalidCredentialsError } from '../errors/AuthError'; import { InvalidCredentialsError, JwtNotProvidedError } from '../errors/AuthError';
import { RunnerEmailNeededError, RunnerNotFoundError } from '../errors/RunnerErrors'; import { RunnerEmailNeededError, RunnerNotFoundError } from '../errors/RunnerErrors';
import { RunnerGroupNotFoundError } from '../errors/RunnerGroupErrors'; import { RunnerGroupNotFoundError } from '../errors/RunnerGroupErrors';
import { RunnerOrganisationNotFoundError } from '../errors/RunnerOrganisationErrors'; import { RunnerOrganisationNotFoundError } from '../errors/RunnerOrganisationErrors';
@ -69,6 +69,7 @@ export class RunnerSelfServiceController {
* @param token The runner jwt provided by the runner to identitfy themselves. * @param token The runner jwt provided by the runner to identitfy themselves.
*/ */
private async getRunner(token: string): Promise<Runner> { private async getRunner(token: string): Promise<Runner> {
if (token == "") { throw new JwtNotProvidedError(); }
let jwtPayload = undefined let jwtPayload = undefined
try { try {
jwtPayload = <any>jwt.verify(token, config.jwt_secret); jwtPayload = <any>jwt.verify(token, config.jwt_secret);