From 74bc9612cc3077d792ba33f9e10312fb102ba99e Mon Sep 17 00:00:00 2001 From: David Mehren Date: Thu, 29 Apr 2021 15:07:50 +0200 Subject: [PATCH] AuthService: Remove null from toAuthTokenDto return type toAuthTokenDto won't return null, as TS's strict mode prevents authToken from being nullish Signed-off-by: David Mehren --- src/auth/auth.service.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index 833c24232..90fe642a7 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -173,14 +173,7 @@ export class AuthService { await this.authTokenRepository.remove(token); } - toAuthTokenDto(authToken: AuthToken): AuthTokenDto | null { - if (!authToken) { - this.logger.warn( - `Recieved ${String(authToken)} argument!`, - 'toAuthTokenDto', - ); - return null; - } + toAuthTokenDto(authToken: AuthToken): AuthTokenDto { const tokenDto: AuthTokenDto = { lastUsed: null, validUntil: null,