Fix various ESLint errors in services

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-24 22:35:06 +01:00
parent 4d94739a9f
commit 1cc86a728a
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 11 additions and 6 deletions

View file

@ -117,7 +117,9 @@ export class AuthService {
new Date(validUntil),
);
}
const createdToken = await this.authTokenRepository.save(token);
const createdToken = (await this.authTokenRepository.save(
token,
)) as AuthToken;
return this.toAuthTokenWithSecretDto(createdToken, `${keyId}.${secret}`);
}
@ -150,7 +152,7 @@ export class AuthService {
) {
// tokens validUntil Date lies in the past
throw new TokenNotValidError(
`AuthToken '${token}' is not valid since ${accessToken.validUntil}.`,
`AuthToken '${token}' is not valid since ${accessToken.validUntil.toISOString()}.`,
);
}
return accessToken;
@ -173,7 +175,10 @@ export class AuthService {
toAuthTokenDto(authToken: AuthToken): AuthTokenDto | null {
if (!authToken) {
this.logger.warn(`Recieved ${authToken} argument!`, 'toAuthTokenDto');
this.logger.warn(
`Recieved ${String(authToken)} argument!`,
'toAuthTokenDto',
);
return null;
}
const tokenDto: AuthTokenDto = {