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.
Related Issue (include '#'): React Error Appearing After Web Token Expiration #496
Description of changes made: Incorporated temporary workaround for issue regarding cached expired web tokens. Changed behavior so that once a web token expires, the user is logged out - Django-Knox's default token lifetime is 10 hours, which is what is currently implemented.
Ideally, we would like it so that once
Is the feature complete/bug resolved/etc..: This PR serves as a temporary workaround to implementation of larger auth issues.
Any known bugs/strange behavior: Because the default expiration time is 10hrs, it is inefficient to test as such. You can configure the token expiry length in the
/api/api/settings.py
file. I incorporated the following code for testing purposes (this has been excluded from the commit):Additional context: Based off my research, it does not seem that knox has the same token 'refresh' implementations that DRF JWT has implemented, in that there is not a specific endpoint for token refreshes. It appears this may currently be in the works:
jazzband/django-rest-knox#156
Looking in to alternatives, but this should at least prevent this error from coming up.