mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-12-01 09:24:46 +00:00
feat(auth): add password reset and recovery flow
This commit is contained in:
parent
e60d31a1b4
commit
2c65baecbb
6 changed files with 184 additions and 18 deletions
10
apps/pwa/src/migrations/007_password_resets.sql
Normal file
10
apps/pwa/src/migrations/007_password_resets.sql
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
CREATE TABLE IF NOT EXISTS password_resets (
|
||||
id TEXT PRIMARY KEY,
|
||||
user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
token_hash TEXT NOT NULL UNIQUE,
|
||||
created_at INTEGER NOT NULL,
|
||||
expires_at INTEGER NOT NULL,
|
||||
used_at INTEGER
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_password_resets_user ON password_resets(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_password_resets_expiry ON password_resets(expires_at);
|
||||
Loading…
Add table
Add a link
Reference in a new issue