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 <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-04-29 15:07:50 +02:00
parent a6e245c551
commit 74bc9612cc
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -173,14 +173,7 @@ export class AuthService {
await this.authTokenRepository.remove(token); await this.authTokenRepository.remove(token);
} }
toAuthTokenDto(authToken: AuthToken): AuthTokenDto | null { toAuthTokenDto(authToken: AuthToken): AuthTokenDto {
if (!authToken) {
this.logger.warn(
`Recieved ${String(authToken)} argument!`,
'toAuthTokenDto',
);
return null;
}
const tokenDto: AuthTokenDto = { const tokenDto: AuthTokenDto = {
lastUsed: null, lastUsed: null,
validUntil: null, validUntil: null,