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);`, )