mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 18:55:19 -04:00
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:
parent
6a6dc7ea21
commit
6ffeb2e9c9
8 changed files with 26 additions and 20 deletions
|
@ -49,17 +49,17 @@ export class AuthService {
|
|||
}
|
||||
const accessToken = await this.getAuthTokenAndValidate(keyId, secret);
|
||||
await this.setLastUsedToken(keyId);
|
||||
return this.usersService.getUserByUsername(accessToken.user.userName);
|
||||
return await this.usersService.getUserByUsername(accessToken.user.userName);
|
||||
}
|
||||
|
||||
async hashPassword(cleartext: string): Promise<string> {
|
||||
// hash the password with bcrypt and 2^12 iterations
|
||||
// this was decided on the basis of https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#bcrypt
|
||||
return hash(cleartext, 12);
|
||||
return await hash(cleartext, 12);
|
||||
}
|
||||
|
||||
async checkPassword(cleartext: string, password: string): Promise<boolean> {
|
||||
return compare(cleartext, password);
|
||||
return await compare(cleartext, password);
|
||||
}
|
||||
|
||||
async randomString(length: number): Promise<Buffer> {
|
||||
|
@ -209,13 +209,13 @@ export class AuthService {
|
|||
// Delete all non valid tokens every sunday on 3:00 AM
|
||||
@Cron('0 0 3 * * 0')
|
||||
async handleCron() {
|
||||
return this.removeInvalidTokens();
|
||||
return await this.removeInvalidTokens();
|
||||
}
|
||||
|
||||
// Delete all non valid tokens 5 sec after startup
|
||||
@Timeout(5000)
|
||||
async handleTimeout() {
|
||||
return this.removeInvalidTokens();
|
||||
return await this.removeInvalidTokens();
|
||||
}
|
||||
|
||||
async removeInvalidTokens() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue