diff --git a/src/users/users.service.ts b/src/users/users.service.ts index bde0de6ce..9de3730c0 100644 --- a/src/users/users.service.ts +++ b/src/users/users.service.ts @@ -41,7 +41,8 @@ export class UsersService { let accessToken = ''; for (let i = 0; i < 100; i++) { try { - accessToken = crypt.randomBytes(64).toString(); + const randomString = crypt.randomBytes(64).toString(); + accessToken = await this.hashPassword(randomString); await this.getUserByAuthToken(accessToken); } catch (NotInDBError) { const token = AuthToken.create(user, identifier, accessToken);