Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3492584
D6098.id20352.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
709 B
Referenced Files
None
Subscribers
None
D6098.id20352.diff
View Options
diff --git a/keyserver/src/deleters/account-deleters.js b/keyserver/src/deleters/account-deleters.js
--- a/keyserver/src/deleters/account-deleters.js
+++ b/keyserver/src/deleters/account-deleters.js
@@ -35,7 +35,13 @@
throw new ServerError('internal_error');
}
const row = result[0];
- if (!bcrypt.compareSync(request.password, row.hash)) {
+ const requestPasswordConsistentWithDB = !!row.hash === !!request.password;
+ const shouldValidatePassword = !!row.hash;
+ if (
+ !requestPasswordConsistentWithDB ||
+ (shouldValidatePassword &&
+ !bcrypt.compareSync(request.password, row.hash))
+ ) {
throw new ServerError('invalid_credentials');
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 12:42 AM (20 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2679083
Default Alt Text
D6098.id20352.diff (709 B)
Attached To
Mode
D6098: Implement logic to skip password validation when account does not have one
Attached
Detach File
Event Timeline
Log In to Comment