|
@@ -99,7 +99,7 @@ let jwtDecode = function(token) {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-const authReducer = function(state = {}, {type, token}) {
|
|
|
|
|
|
+const authReducer = function(state, {type, token}) {
|
|
let payload;
|
|
let payload;
|
|
|
|
|
|
if (state == undefined) {
|
|
if (state == undefined) {
|
|
@@ -115,12 +115,12 @@ const authReducer = function(state = {}, {type, token}) {
|
|
|
|
|
|
if(payload) {
|
|
if(payload) {
|
|
localStorage.authToken = token;
|
|
localStorage.authToken = token;
|
|
|
|
+ return {
|
|
|
|
+ token: token,
|
|
|
|
+ payload: payload
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- return {
|
|
|
|
- token: token,
|
|
|
|
- payload: payload
|
|
|
|
- }
|
|
|
|
};
|
|
};
|
|
if (type == "AUTH_LOGOUT") {
|
|
if (type == "AUTH_LOGOUT") {
|
|
localStorage.removeItem("authToken");
|
|
localStorage.removeItem("authToken");
|