mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-03-22 19:44:27 +00:00
AuthService: randomString does not need to by async
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
ba4825a99f
commit
b5281991ef
1 changed files with 3 additions and 3 deletions
|
@ -62,7 +62,7 @@ export class AuthService {
|
|||
return await compare(cleartext, password);
|
||||
}
|
||||
|
||||
async randomString(length: number): Promise<Buffer> {
|
||||
randomString(length: number): Buffer {
|
||||
if (length <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ export class AuthService {
|
|||
`User '${user.userName}' has already 200 tokens and can't have anymore`,
|
||||
);
|
||||
}
|
||||
const secret = this.bufferToBase64Url(await this.randomString(54));
|
||||
const keyId = this.bufferToBase64Url(await this.randomString(8));
|
||||
const secret = this.bufferToBase64Url(this.randomString(54));
|
||||
const keyId = this.bufferToBase64Url(this.randomString(8));
|
||||
const accessToken = await this.hashPassword(secret);
|
||||
let token;
|
||||
// Tokens can only be valid for a maximum of 2 years
|
||||
|
|
Loading…
Reference in a new issue