I’ve racked my brain on this for 20 hours straight and I can’t figure it out. I’m working on an ember app with a django backend. It uses jwt for authorization, the endpoint to generate the initial tokens is:
/token/
and it generates the following (I’ve changed the strings here for security, but I do get back valid web tokens):
{
"data": {
"refresh": "dsjgkdsfjgdfslkjgfdjgkldfjglsdfkjgfdlkgjfdlg",
"access": "dsdgjdsgjdsgjdfsgjdfsklgjdfslgjdfsgjfdsgjdflgjdfk;gjdfsl;gjdfgjfdklgjfdlgI"
}
}
When the access token expires I try to send the refresh token to /token/refresh
but the response I get back is :
Uncaught (in promise) Error: Refresh token is empty. Please check your backend response
I’m using the ember-simple-auth-token addon
and I believe I’ve set up the config properly in environment.js
:
'ember-simple-auth-token': {
tokenDataPropertyName: 'tokenData', // Key in session to store token data
refreshAccessTokens: true, // Enables access token refreshing
tokenExpirationInvalidateSession: true, // Enables session invalidation on token expiration
serverTokenRefreshEndpoint: 'http://localhost:8000/api/token/refresh/', // Server endpoint to send refresh request
refreshTokenPropertyName: 'refresh', // Key in server response that contains the refresh token
tokenExpireName: 'exp', // Field containing token expiration
refreshLeeway: 290, // Amount of time to send refresh request before token expiration
serverTokenEndpoint: 'http://localhost:8000/api/token/',
tokenPropertyName: 'access',
}
Any help would be greatly appreciated, thank you.