mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 18:55:19 -04:00
refactor(user): lazy-load relations
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
4483d2b898
commit
977ed4b9fa
4 changed files with 17 additions and 17 deletions
|
@ -65,9 +65,9 @@ export class AuthService {
|
|||
identifier: string,
|
||||
validUntil: TimestampMillis,
|
||||
): Promise<AuthTokenWithSecretDto> {
|
||||
user.authTokens = await this.getTokensByUser(user);
|
||||
user.authTokens = this.getTokensByUser(user);
|
||||
|
||||
if (user.authTokens.length >= 200) {
|
||||
if ((await user.authTokens).length >= 200) {
|
||||
// This is a very high ceiling unlikely to hinder legitimate usage,
|
||||
// but should prevent possible attack vectors
|
||||
throw new TooManyTokensError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue