feat: увеличить время жизни access token до 24 часов, сделать refresh token бессрочным
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 33s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 33s
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
-- Migration: Make refresh tokens permanent (no expiration)
|
||||
-- Refresh tokens теперь не имеют срока действия (expires_at может быть NULL)
|
||||
-- Access tokens живут 24 часа вместо 15 минут
|
||||
|
||||
-- ============================================
|
||||
-- 1. Изменяем expires_at на NULLABLE
|
||||
-- ============================================
|
||||
ALTER TABLE refresh_tokens
|
||||
ALTER COLUMN expires_at DROP NOT NULL;
|
||||
|
||||
-- ============================================
|
||||
-- 2. Устанавливаем NULL для всех существующих токенов
|
||||
-- (или можно оставить их как есть, если они еще не истекли)
|
||||
-- ============================================
|
||||
-- UPDATE refresh_tokens SET expires_at = NULL WHERE expires_at > NOW();
|
||||
|
||||
-- ============================================
|
||||
-- 3. Комментарий
|
||||
-- ============================================
|
||||
COMMENT ON COLUMN refresh_tokens.expires_at IS 'Expiration date for refresh token. NULL means token never expires.';
|
||||
|
||||
Reference in New Issue
Block a user