Page MenuHomePhabricator

D9236.id31291.diff
No OneTemporary

D9236.id31291.diff

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

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)

Event Timeline