From 67d64ec4b368c48188c746f2dba2967ec4615fe5 Mon Sep 17 00:00:00 2001
From: Ellie Huxtable <ellie@elliehuxtable.com>
Date: Mon, 24 Jun 2024 14:54:54 +0100
Subject: feat: add user account verification (#2190)

* add verified column to users table

* add database functions to check if verified, or to verify

* getting there

* verification check

* use base64 urlsafe no pad

* add verification client

* clippy

* correct docs

* fix integration tests
---
 .../migrations/20240621110731_user-verified.sql                   | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 crates/atuin-server-postgres/migrations/20240621110731_user-verified.sql

(limited to 'crates/atuin-server-postgres/migrations/20240621110731_user-verified.sql')

diff --git a/crates/atuin-server-postgres/migrations/20240621110731_user-verified.sql b/crates/atuin-server-postgres/migrations/20240621110731_user-verified.sql
new file mode 100644
index 00000000..6eba02ec
--- /dev/null
+++ b/crates/atuin-server-postgres/migrations/20240621110731_user-verified.sql
@@ -0,0 +1,8 @@
+alter table users add verified_at timestamp with time zone default null;
+
+create table user_verification_token(
+  id bigserial primary key, 
+  user_id bigint unique references users(id), 
+  token text, 
+  valid_until timestamp with time zone
+);
-- 
cgit v1.3.1

