Add email verification and password reset
mindflux-ci / build (push) Successful in 2m26s

This commit is contained in:
AliceDarkest
2026-07-15 11:10:07 +02:00
parent 80f556b1d0
commit ce1975b47a
19 changed files with 467 additions and 13 deletions
@@ -0,0 +1,17 @@
ALTER TABLE users
ADD COLUMN email_verified BOOLEAN NOT NULL DEFAULT TRUE;
CREATE TABLE account_email_tokens (
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
token_hash CHAR(64) NOT NULL UNIQUE,
purpose VARCHAR(32) NOT NULL,
expires_at TIMESTAMP NOT NULL,
consumed_at TIMESTAMP,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT account_email_tokens_purpose_check
CHECK (purpose IN ('EMAIL_VERIFICATION', 'PASSWORD_RESET'))
);
CREATE INDEX idx_account_email_tokens_lookup
ON account_email_tokens (token_hash, purpose);