From 6f4a04c0155ecd0bdb2d78e7ef65f506bc0dff79 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 22 Jan 2022 07:53:00 +0100 Subject: [PATCH] comments and also check for email confirmed --- database/migrations/0009-login_users_plug_holes.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/migrations/0009-login_users_plug_holes.ts b/database/migrations/0009-login_users_plug_holes.ts index 9366c2e59..62cdfc44a 100644 --- a/database/migrations/0009-login_users_plug_holes.ts +++ b/database/migrations/0009-login_users_plug_holes.ts @@ -6,12 +6,14 @@ */ export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { - // Generate a random private key where the remaining data is present + // Generate a random private key where the required data is present (pubkey + password + passphrase). + // Furthermore the email needs to be confirmed await queryFn( `UPDATE login_users SET privkey = UNHEX(SHA1(RAND())) WHERE privkey IS NULL AND pubkey IS NOT NULL AND password != 0 + AND email_checked = 1 AND id IN (SELECT user_id FROM login_user_backups);`, )