diff --git a/demo/demo/settings.py b/demo/demo/settings.py index c001399..4496f0d 100644 --- a/demo/demo/settings.py +++ b/demo/demo/settings.py @@ -116,10 +116,14 @@ ACCOUNT_EMAIL_REQUIRED = False ACCOUNT_AUTHENTICATION_METHOD = 'username' ACCOUNT_EMAIL_VERIFICATION = 'optional' +REST_USE_JWT = True +JWT_AUTH_COOKIE = 'auth' + REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.TokenAuthentication', + 'dj_rest_auth.utils.JWTCookieAuthentication' ), 'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema' } @@ -130,4 +134,5 @@ SWAGGER_SETTINGS = { } -CORS_ORIGIN_ALLOW_ALL = True # For demo purposes only. Use a white list in the real world. \ No newline at end of file +# For demo purposes only. Use a white list in the real world. +CORS_ORIGIN_ALLOW_ALL = True diff --git a/demo/react-spa/src/App.css b/demo/react-spa/src/App.css index 74b5e05..92fd3ac 100644 --- a/demo/react-spa/src/App.css +++ b/demo/react-spa/src/App.css @@ -1,5 +1,6 @@ .App { text-align: center; + width: 100%; } .App-logo { @@ -22,6 +23,7 @@ justify-content: center; font-size: calc(10px + 2vmin); color: white; + width: 100%; } .App-link { diff --git a/demo/react-spa/src/App.js b/demo/react-spa/src/App.js index 70fedad..a8546a4 100644 --- a/demo/react-spa/src/App.js +++ b/demo/react-spa/src/App.js @@ -18,21 +18,28 @@ function App() { body: JSON.stringify({username, password}) }).then(resp => resp.json()).then(data => { changeResponse(data) - }) + }).catch(error => console.log('error ->', error)) } return (
+
- + +
+ {JSON.stringify(resp)}
+
+