mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-04 19:50:00 +00:00
Nutomic
dc327652a5
* wip * stuff * fmt * fmt 2 * fmt 3 * fix default feature * use Authorization header * store ip and user agent for each login * add list_logins endpoint * serde(skip) for token * fix api tests * A few suggestions for login_token (#3991) * A few suggestions. * Fixing SQL format. * review * review * rename cookie --------- Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
15 lines
458 B
SQL
15 lines
458 B
SQL
CREATE TABLE login_token (
|
|
id serial PRIMARY KEY,
|
|
token text NOT NULL UNIQUE,
|
|
user_id int REFERENCES local_user ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
|
|
published timestamptz NOT NULL DEFAULT now(),
|
|
ip text,
|
|
user_agent text
|
|
);
|
|
|
|
CREATE INDEX idx_login_token_user_token ON login_token (user_id, token);
|
|
|
|
-- not needed anymore as we invalidate login tokens on password change
|
|
ALTER TABLE local_user
|
|
DROP COLUMN validator_time;
|
|
|