Implement Secure Refresh Token Rotation with Revocation Support
This commit is contained in:
committed by
Aditya Chandel
parent
277b82263d
commit
2407cf93fa
@@ -0,0 +1,14 @@
|
||||
CREATE TABLE refresh_token
|
||||
(
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
user_id BIGINT NOT NULL,
|
||||
token VARCHAR(512) NOT NULL,
|
||||
expiry_date TIMESTAMP NOT NULL,
|
||||
revoked BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
revocation_date TIMESTAMP NULL,
|
||||
|
||||
CONSTRAINT uq_refresh_token UNIQUE (token),
|
||||
CONSTRAINT fk_refresh_token_user FOREIGN KEY (user_id)
|
||||
REFERENCES users (id)
|
||||
ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user