Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3158073
D9236.id31291.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9236.id31291.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
@@ -1,7 +1,6 @@
// @flow
import { getRustAPI } from 'rust-node-addon';
-import bcrypt from 'twin-bcrypt';
import type {
LogOutResponse,
@@ -34,24 +33,6 @@
throw new ServerError('not_logged_in');
}
- if (request) {
- const hashQuery = SQL`SELECT hash FROM users WHERE id = ${viewer.userID}`;
- const [result] = await dbQuery(hashQuery);
- if (result.length === 0) {
- throw new ServerError('internal_error');
- }
- const row = result[0];
- const requestPasswordConsistentWithDB = !!row.hash === !!request.password;
- const shouldValidatePassword = !!row.hash;
- if (
- !requestPasswordConsistentWithDB ||
- (shouldValidatePassword &&
- !bcrypt.compareSync(request.password, row.hash))
- ) {
- throw new ServerError('invalid_credentials');
- }
- }
-
const deletedUserID = viewer.userID;
await rescindPushNotifs(SQL`n.user = ${deletedUserID}`, SQL`NULL`);
const knownUserInfos = await fetchKnownUserInfos(viewer);
diff --git a/lib/types/account-types.js b/lib/types/account-types.js
--- a/lib/types/account-types.js
+++ b/lib/types/account-types.js
@@ -80,7 +80,7 @@
};
export type DeleteAccountRequest = {
- +password: ?string,
+ +password?: ?string,
};
export const logInActionSources = Object.freeze({
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 9:28 PM (21 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2432521
Default Alt Text
D9236.id31291.diff (1 KB)
Attached To
Mode
D9236: [keyserver] Update keyserver delete account endpoint to not require password
Attached
Detach File
Event Timeline
Log In to Comment