feat: password reset

This commit is contained in:
Krispire Admin
2026-06-02 18:37:08 +05:30
parent ac95a857bd
commit cf3a49458a
8 changed files with 303 additions and 39 deletions
@@ -0,0 +1,3 @@
-- Reverting this requires backfilling NULL emails with synthetic values
-- first; left as a manual step (see operational runbook).
ALTER TABLE users ALTER COLUMN email SET NOT NULL;
@@ -0,0 +1,10 @@
-- Some auth providers (Facebook in particular) let users sign up without
-- linking a verified email — phone-only accounts and accounts whose owner
-- declined the `email` permission both fall under this. To accept those
-- users we need to allow NULL on users.email.
--
-- The UNIQUE constraint stays put: Postgres treats NULLs as distinct under
-- a regular UNIQUE index (multiple rows with NULL email are allowed) so
-- nothing breaks for OAuth-only users with no address on file. Real email
-- addresses are still de-duplicated, exactly as before.
ALTER TABLE users ALTER COLUMN email DROP NOT NULL;