comments and also check for email confirmed

This commit is contained in:
Ulf Gebhardt 2022-01-22 07:53:00 +01:00
parent 3f4ce13cc8
commit 6f4a04c015
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -6,12 +6,14 @@
*/
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
// 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);`,
)