mirror of
https://github.com/Noratrieb/oh-oh.git
synced 2026-01-17 02:15:05 +01:00
2fa
This commit is contained in:
parent
0f46ff5a89
commit
c789f7ad15
10 changed files with 406 additions and 9 deletions
19
idp/migrations/20250712211103_totp.sql
Normal file
19
idp/migrations/20250712211103_totp.sql
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
CREATE TABLE IF NOT EXISTS used_totp (
|
||||
user_id INTEGER,
|
||||
code TEXT,
|
||||
|
||||
PRIMARY KEY (user_id, code),
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
) STRICT;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS totp_devices (
|
||||
id INTEGER PRIMARY KEY,
|
||||
user_id INTEGER NOT NULL,
|
||||
secret TEXT NOT NULL,
|
||||
created_time INTEGER NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
) STRICT;
|
||||
|
||||
CREATE INDEX totp_devices_user_id ON totp_devices(user_id);
|
||||
Loading…
Add table
Add a link
Reference in a new issue