mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-25 20:18:25 +02:00
Better naming, start on temp tokens table, etc.
This commit is contained in:
parent
29e0c8f790
commit
4158b07ad0
4 changed files with 119 additions and 19 deletions
|
@ -203,6 +203,22 @@ const DB_INIT_TABLE = {
|
|||
);`
|
||||
);
|
||||
|
||||
//
|
||||
// Table for temporary tokens, generally used for e.g. 'outside'
|
||||
// access such as email links.
|
||||
// Examples: PW reset, enabling of 2FA/OTP, etc.
|
||||
//
|
||||
dbs.user.run(
|
||||
`CREATE TABLE IF NOT EXISTS user_temporary_token (
|
||||
user_id INTEGER NOT NULL,
|
||||
token VARCHAR NOT NULL,
|
||||
timestamp DATETIME NOT NULL,
|
||||
purpose VARCHAR NOT NULL,
|
||||
UNIQUE(user_id, token),
|
||||
FOREIGN KEY(user_id) REFERENCES user(id) ON DELETE CASCADE
|
||||
);`
|
||||
);
|
||||
|
||||
return cb(null);
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue