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

Add @jwt_refresh_cookie decorator #287

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mongkok
Copy link
Member

@mongkok mongkok commented Aug 28, 2021

ref #217 #230 #276

@jwt_cookie

from django.urls import path

from graphene_django.views import GraphQLView
from graphql_jwt.decorators import jwt_cookie

urlpatterns = [
   path("graphql/", jwt_cookie(GraphQLView.as_view())),
]
GRAPHQL_JWT = {
    "JWT_VERIFY_EXPIRATION": True,
    "JWT_LONG_RUNNING_REFRESH_TOKEN": True,
    "JWT_HIDE_TOKEN_FIELDS": True,
}

@jwt_refresh_cookie 🆕

from django.urls import path

from graphene_django.views import GraphQLView
from graphql_jwt.decorators import jwt_refresh_cookie

urlpatterns = [
  path("graphql/", jwt_refresh_cookie(GraphQLView.as_view())),
]
GRAPHQL_JWT = {
    "JWT_VERIFY_EXPIRATION": True,
    "JWT_LONG_RUNNING_REFRESH_TOKEN": True,
    "JWT_HIDE_REFRESH_TOKEN_FIELD": True,
}

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2021

Codecov Report

Merging #287 (0776daf) into main (704f24e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #287   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files          47       47           
  Lines        1321     1321           
=======================================
  Hits         1319     1319           
  Misses          2        2           
Impacted Files Coverage Δ
graphql_jwt/decorators.py 100.00% <ø> (ø)
graphql_jwt/settings.py 100.00% <ø> (ø)
graphql_jwt/mixins.py 100.00% <100.00%> (ø)
graphql_jwt/refresh_token/mixins.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 704f24e...0776daf. Read the comment docs.

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.

3 participants