Last active
July 16, 2021 13:32
-
-
Save joaquinacuna/b2ec5e6d173fd3bba3363705e5a6bba7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# auth.settings.py | |
INSTALLED_APPS = [ | |
# ... | |
'django.contrib.staticfiles', # Required for GraphiQL | |
'graphene_django', | |
# refresh tokens are optional | |
'graphql_jwt.refresh_token.apps.RefreshTokenConfig', | |
] | |
MIDDLEWARE = [ | |
# ... | |
'django.contrib.auth.middleware.AuthenticationMiddleware', | |
# ... | |
] | |
GRAPHENE = { | |
'SCHEMA': 'auth.schema.schema', # this file doesn't exist yet | |
'MIDDLEWARE': [ | |
'graphql_jwt.middleware.JSONWebTokenMiddleware', | |
], | |
} | |
AUTHENTICATION_BACKENDS = [ | |
'graphql_jwt.backends.JSONWebTokenBackend', | |
'django.contrib.auth.backends.ModelBackend', | |
] | |
GRAPHQL_JWT = { | |
"JWT_VERIFY_EXPIRATION": True, | |
# optional | |
"JWT_LONG_RUNNING_REFRESH_TOKEN": True, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment