You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.
개요
백엔드에서 삭제된 토큰이
Redux Store
에 갱신되지 않는 오류를 해결한다.문제 상황
로그인 시 백엔드에 생성되는 토큰은
Django-Rest-Knox
라는 라이브러리에 의존한다. 해당 토큰은 링크와 같은 설정으로 관리되고 있는데, 이 중TOKEN_TTL
이라는 설정을 통해 토큰의 유효 기간을 설정할 수 있으며 기본값은 10시간이다.유효 기간이 지난 후, 토큰이 만료되어 삭제된다면 프론트엔드의
Redux Store
에 남아있는 토큰과 유저 정보를 삭제해 다시 로그인하도록 유도해야 한다. 그러나 현재 해당 기능이 구현되어있지 않아 만료된 토큰을 지속적으로 저장하고 있다.해결 방법
우선적으로, 백엔드에서 해당 토큰의 유효 여부를 확인하는
View
가 필요하다. 이후 해당View
에 접근하여, 토큰의 유효 여부에 따라Redux Store
를 갱신한다.The text was updated successfully, but these errors were encountered: