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