This repository has been archived by the owner on Oct 30, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements JWT token refreshing. Access tokens will be valid for shorter (
JWT_ACCESS_TOKEN_LIFETIME_HOURS
) time and refresh tokens will be used to regenerate them. The refresh tokens are rotating, so we won't need to log in anymore as long as we visit the page once perJWT_REFRESH_TOKEN_LIFETIME_DAYS
days.I added one new line to envs on the ticket:
JWT_ACCESS_TOKEN_LIFETIME_HOURS=0.0004
. This will make access tokens last for less than 2 seconds, which will be enough for making singular requests and will speed up the testing.Testing instructions:
.env
file (you can find it in a comment on the ticket).docker-compose -f local.yml up --build
(build
is important here; it will take a while, because our first layer of the Dockerfile has changed).docker-compose -f local.yml exec django python manage.py migrate
.frontent/src/App.js
.npm i && npm start
.user/
returned 401, was followed byrefresh/
, which returned 200, which was then followed byuser/
returning 200.?board_id=<id>
endpoint.