redux-auth-wrapper
Advanced tools
Comparing version
@@ -41,3 +41,4 @@ 'use strict'; | ||
var allArgs = _extends({}, connectedDefaults, args); | ||
var redirectPath = allArgs.redirectPath, | ||
var FailureComponent = allArgs.FailureComponent, | ||
redirectPath = allArgs.redirectPath, | ||
authenticatedSelector = allArgs.authenticatedSelector, | ||
@@ -81,2 +82,8 @@ authenticatingSelector = allArgs.authenticatingSelector, | ||
var ConnectedFailureComponent = (0, _reactRedux.connect)(function (state, ownProps) { | ||
return { | ||
redirect: redirect(getRouterRedirect(ownProps)) | ||
}; | ||
})(FailureComponent); | ||
return function (DecoratedComponent) { | ||
@@ -87,6 +94,5 @@ return (0, _reactRedux.connect)(function (state, ownProps) { | ||
isAuthenticated: authenticatedSelector(state, ownProps), | ||
isAuthenticating: authenticatingSelector(state, ownProps), | ||
redirect: redirect(getRouterRedirect(ownProps)) | ||
isAuthenticating: authenticatingSelector(state, ownProps) | ||
}; | ||
})((0, _authWrapper2.default)(allArgs)(DecoratedComponent)); | ||
})((0, _authWrapper2.default)(_extends({}, allArgs, { FailureComponent: ConnectedFailureComponent }))(DecoratedComponent)); | ||
}; | ||
@@ -97,3 +103,4 @@ }; | ||
var allArgs = _extends({}, connectedDefaults, args); | ||
var redirectPath = allArgs.redirectPath, | ||
var FailureComponent = allArgs.FailureComponent, | ||
redirectPath = allArgs.redirectPath, | ||
authenticatedSelector = allArgs.authenticatedSelector, | ||
@@ -140,2 +147,4 @@ authenticatingSelector = allArgs.authenticatingSelector, | ||
var ConnectedFailureComponent = (0, _reactRedux.connect)(null, createRedirect)(FailureComponent); | ||
return function (DecoratedComponent) { | ||
@@ -148,3 +157,3 @@ return (0, _reactRedux.connect)(function (state, ownProps) { | ||
}; | ||
}, createRedirect)((0, _authWrapper2.default)(allArgs)(DecoratedComponent)); | ||
})((0, _authWrapper2.default)(_extends({}, allArgs, { FailureComponent: ConnectedFailureComponent }))(DecoratedComponent)); | ||
}; | ||
@@ -151,0 +160,0 @@ }; |
{ | ||
"name": "redux-auth-wrapper", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"main": "index.js", | ||
@@ -12,3 +12,3 @@ "description": "A utility library for handling authentication and authorization for redux and react-router", | ||
"dist:prepare": "npm run build:clean && npm run build && npm run build:copyFiles", | ||
"lint": "eslint src test", | ||
"lint": "eslint src test examples", | ||
"test": "mocha --compilers js:babel-core/register --recursive --require test/init.js test/authWrapper-test.js", | ||
@@ -67,5 +67,5 @@ "test:cov": "babel-node --max-old-space-size=4076 $(npm bin)/babel-istanbul cover $(npm bin)/_mocha -- --require test/init.js test/authWrapper-test.js", | ||
"lodash.isempty": "4.4.0", | ||
"prop-types": "15.5.8", | ||
"prop-types": "^15.5.0", | ||
"query-string": "4.3.4" | ||
} | ||
} |
29281
1.62%447
1.59%+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated