mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-30 20:43:39 +00:00
private: save token hashed
Auth tokens are now saved in hashed form. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
e5545043be
commit
822c01f2c7
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue