Modified regex

pull/316/head
Tedy Stoica 2019-01-08 12:15:20 +02:00
parent 6c4d06b2a8
commit 99bc50f2ff
No known key found for this signature in database
GPG Key ID: D5C8034B0199CAE6
1 changed files with 9 additions and 9 deletions

View File

@ -68,7 +68,7 @@ export class FileUsersDatabase implements IUsersDatabase {
password: string) password: string)
: Bluebird<void> { : Bluebird<void> {
const storedHash: string = database.users[username].password; const storedHash: string = database.users[username].password;
const matches = storedHash.match(/rounds=([0-9]+)\$([a-zA-z0-9]+)\$/); const matches = storedHash.match(/rounds=([0-9]+)\$([a-zA-z0-9.]+)\$/);
if (!(matches && matches.length == 3)) { if (!(matches && matches.length == 3)) {
return Bluebird.reject(new Error("Unable to detect the hash salt and rounds. " + return Bluebird.reject(new Error("Unable to detect the hash salt and rounds. " +
"Make sure the password is hashed with SSHA512.")); "Make sure the password is hashed with SSHA512."));