mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-10 21:54:19 +00:00
feat: add support for email verification (#1223)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DROP TABLE email_verification_tokens;
|
||||
ALTER TABLE users DROP COLUMN email_verified;
|
||||
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE email_verification_tokens
|
||||
(
|
||||
id UUID PRIMARY KEY,
|
||||
created_at TIMESTAMPTZ NOT NULL,
|
||||
token TEXT NOT NULL UNIQUE,
|
||||
expires_at TIMESTAMPTZ NOT NULL,
|
||||
user_id UUID NOT NULL REFERENCES users ON DELETE CASCADE
|
||||
);
|
||||
|
||||
ALTER TABLE users
|
||||
ADD COLUMN email_verified BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
UPDATE users
|
||||
SET email_verified = EXISTS (SELECT 1
|
||||
FROM app_config_variables
|
||||
WHERE key = 'emailsVerified'
|
||||
AND value = 'true');
|
||||
Reference in New Issue
Block a user