Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated cached token issue #510

Merged
merged 1 commit into from
Apr 6, 2020
Merged

updated cached token issue #510

merged 1 commit into from
Apr 6, 2020

Conversation

caioingber
Copy link
Contributor

  • 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):

REST_KNOX = {
    'TOKEN_TTL': timedelta(seconds=30),
}

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.

  • Is there specific feedback you would like on these changes: n/a

@caioingber caioingber requested review from Underwaterr and 0xZakk April 6, 2020 15:32
@caioingber caioingber self-assigned this Apr 6, 2020
@caioingber caioingber linked an issue Apr 6, 2020 that may be closed by this pull request
@Underwaterr Underwaterr requested review from 0xZakk and removed request for 0xZakk and Underwaterr April 6, 2020 17:20
@0xZakk 0xZakk merged commit f7821d2 into develop Apr 6, 2020
@0xZakk 0xZakk deleted the bug-token-refresh branch April 6, 2020 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

React Error Appearing After Web Token Expiration
2 participants