ESLint: Enable @typescript-eslint/return-await rule

This ensures stack traces are helpful at the cost of a slightly
lower performance (one more tick in the event loop).

Fixes #838

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-20 20:14:36 +01:00
parent 2ba824d9e2
commit 9485597e6f
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
8 changed files with 26 additions and 20 deletions

View file

@ -44,12 +44,16 @@ export class TokensController {
@Body('validUntil') validUntil: TimestampMillis,
): Promise<AuthTokenWithSecretDto> {
// ToDo: Get real userName
return this.authService.createTokenForUser('hardcoded', label, validUntil);
return await this.authService.createTokenForUser(
'hardcoded',
label,
validUntil,
);
}
@Delete('/:keyId')
@HttpCode(204)
async deleteToken(@Param('keyId') keyId: string) {
return this.authService.removeToken(keyId);
return await this.authService.removeToken(keyId);
}
}