First draft of token refresh

This commit is contained in:
Jef Roosens 2021-08-22 10:42:58 +02:00
parent badf68e579
commit 7dffbb9597
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
5 changed files with 64 additions and 4 deletions

View file

@ -15,7 +15,7 @@ CREATE TABLE refresh_tokens (
-- This is more efficient than storing the text
token bytea PRIMARY KEY,
-- The user for whom the token was created
user_id uuid NOT NULL REFERENCES users(id),
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
-- When the token expires
expires_at timestamp NOT NULL,
-- When the token was last used (is NULL until used)