@twreporter/redux
Advanced tools
Comparing version 5.0.0-beta.5 to 5.0.0-beta.6
@@ -147,3 +147,2 @@ "use strict"; | ||
var httpClientWithToken = _ref3.httpClientWithToken; | ||
console.log(httpClientWithToken); | ||
var url = (0, _formApiUrl["default"])("".concat(apiEndpoints.getSingleBookmark(userID, bookmarkSlug, bookmarkHost)), false); | ||
@@ -150,0 +149,0 @@ var axiosConfig = { |
@@ -6,10 +6,10 @@ "use strict"; | ||
}); | ||
exports["default"] = void 0; | ||
exports["default"] = auth; | ||
var _actionTypes = _interopRequireDefault(require("../constants/action-types")); | ||
var _jwt = _interopRequireDefault(require("../utils/jwt")); | ||
var _get = _interopRequireDefault(require("lodash/get")); | ||
var _jwt = _interopRequireDefault(require("../utils/jwt")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
@@ -20,5 +20,13 @@ | ||
}; | ||
var initState = { | ||
accessToken: '', | ||
actionType: '', | ||
debugDetails: null, | ||
isAuthed: false, | ||
isRequesting: false, | ||
userInfo: null | ||
}; | ||
function auth() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initState; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
@@ -29,7 +37,3 @@ | ||
{ | ||
return { | ||
actionType: action.type, | ||
isAuthed: false, | ||
isRequesting: false | ||
}; | ||
return initState; | ||
} | ||
@@ -40,6 +44,8 @@ | ||
return { | ||
accessToken: initState.accessToken, | ||
actionType: action.type, | ||
debugDetails: action.payload, | ||
isAuthed: false, | ||
isRequesting: true, | ||
debugDetails: action.payload | ||
userInfo: initState.userInfo | ||
}; | ||
@@ -51,6 +57,8 @@ } | ||
return { | ||
accessToken: initState.accessToken, | ||
actionType: action.type, | ||
debugDetails: action.payload, | ||
isAuthed: false, | ||
isRequesting: false, | ||
debugDetails: action.payload | ||
userInfo: initState.userInfo | ||
}; | ||
@@ -66,8 +74,8 @@ } | ||
return { | ||
accessToken: jwt, | ||
actionType: action.type, | ||
debugDetails: action.payload, | ||
isAuthed: true, | ||
isRequesting: false, | ||
userInfo: userInfo, | ||
accessToken: jwt, | ||
debugDetails: action.payload | ||
userInfo: userInfo | ||
}; | ||
@@ -81,5 +89,2 @@ } | ||
} | ||
} | ||
var _default = auth; | ||
exports["default"] = _default; | ||
} |
{ | ||
"name": "@twreporter/redux", | ||
"version": "5.0.0-beta.5", | ||
"version": "5.0.0-beta.6", | ||
"description": "redux actions and reducers for twreporter website", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133207
2921