Remove header, that is no longer being transmitted
This commit is contained in:
parent
d0337fb640
commit
f85863d965
13
js/api.js
13
js/api.js
|
|
@ -82,11 +82,8 @@ function storeOptionalToken(response) {
|
||||||
|
|
||||||
function checkForAuthenticationHeaders(response) {
|
function checkForAuthenticationHeaders(response) {
|
||||||
if(response.headers) {
|
if(response.headers) {
|
||||||
|
|
||||||
console.log(response);
|
|
||||||
|
|
||||||
const requiredHeaders = [
|
const requiredHeaders = [
|
||||||
'access-token', 'client', 'uid', 'expiry', // TODO: Add last header that is required (I don't remember it right now lol)
|
'access-token', 'client', 'uid', 'expiry'
|
||||||
];
|
];
|
||||||
for(var i = 0; i < requiredHeaders.length; i++) {
|
for(var i = 0; i < requiredHeaders.length; i++) {
|
||||||
if(!response.headers[requiredHeaders[i]]) {
|
if(!response.headers[requiredHeaders[i]]) {
|
||||||
|
|
@ -186,6 +183,12 @@ const reducer_userinfo = (state = defaultstate_userinfo, action) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
case actiontypes_userinfo.LOGOUT:
|
case actiontypes_userinfo.LOGOUT:
|
||||||
|
deleteRequest(state, '/users/sign_out', {}).then((resp) => {
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
/*
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
isSignedIn : false,
|
isSignedIn : false,
|
||||||
username : null,
|
username : null,
|
||||||
|
|
@ -195,9 +198,9 @@ const reducer_userinfo = (state = defaultstate_userinfo, action) => {
|
||||||
expiry : null,
|
expiry : null,
|
||||||
uid : null
|
uid : null
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
case actiontypes_userinfo.STORE_AUTH_HEADERS:
|
case actiontypes_userinfo.STORE_AUTH_HEADERS:
|
||||||
console.log("Token has been stored.");
|
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
accesstoken : action.parameters.accesstoken,
|
accesstoken : action.parameters.accesstoken,
|
||||||
client : action.parameters.client,
|
client : action.parameters.client,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue