database: added totp codes migrations, get/add/use token

This commit is contained in:
Philippe Loctaux 2023-05-01 11:57:41 +02:00
parent f891d2f940
commit 8658966b41
10 changed files with 229 additions and 0 deletions

View file

@ -0,0 +1 @@
drop table if exists totp_login_requests;

View file

@ -0,0 +1,11 @@
create table if not exists totp_login_requests
(
-- info
token TEXT not null primary key,
user TEXT not null references users (id),
-- timings
created_at TEXT not null default CURRENT_TIMESTAMP,
expires_at TEXT not null,
used_at TEXT
);