Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

백엔드에서 삭제된 토큰이 Redux Store에 갱신되지 않는 오류 #50

Open
hatchling13 opened this issue Feb 23, 2021 · 0 comments · Fixed by #51
Open

백엔드에서 삭제된 토큰이 Redux Store에 갱신되지 않는 오류 #50

hatchling13 opened this issue Feb 23, 2021 · 0 comments · Fixed by #51
Assignees
Labels
bug Something isn't working

Comments

@hatchling13
Copy link
Member

개요

백엔드에서 삭제된 토큰이 Redux Store에 갱신되지 않는 오류를 해결한다.

문제 상황

로그인 시 백엔드에 생성되는 토큰은 Django-Rest-Knox라는 라이브러리에 의존한다. 해당 토큰은 링크와 같은 설정으로 관리되고 있는데, 이 중 TOKEN_TTL이라는 설정을 통해 토큰의 유효 기간을 설정할 수 있으며 기본값은 10시간이다.

유효 기간이 지난 후, 토큰이 만료되어 삭제된다면 프론트엔드의 Redux Store에 남아있는 토큰과 유저 정보를 삭제해 다시 로그인하도록 유도해야 한다. 그러나 현재 해당 기능이 구현되어있지 않아 만료된 토큰을 지속적으로 저장하고 있다.

해결 방법

우선적으로, 백엔드에서 해당 토큰의 유효 여부를 확인하는 View가 필요하다. 이후 해당 View에 접근하여, 토큰의 유효 여부에 따라 Redux Store를 갱신한다.

@hatchling13 hatchling13 added the bug Something isn't working label Feb 23, 2021
@hatchling13 hatchling13 self-assigned this Feb 23, 2021
@hatchling13 hatchling13 linked a pull request Feb 23, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant