feat: увеличить время жизни access token до 24 часов, сделать refresh token бессрочным
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 33s

This commit is contained in:
Play Life Bot
2026-01-02 16:00:54 +03:00
parent 8b66e5fd6e
commit d012f39be8
3 changed files with 33 additions and 12 deletions

View File

@@ -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.';