Merge pull request #35 from joshudev/master
Check for hasVerificationBeenAttempted
This commit is contained in:
commit
9d83b38b6c
2
dist/AsyncLocalStorage.js.map
vendored
2
dist/AsyncLocalStorage.js.map
vendored
|
@ -1 +1 @@
|
|||
{"version":3,"file":"AsyncLocalStorage.js","sourceRoot":"","sources":["../src/AsyncLocalStorage.ts"],"names":[],"mappings":";;AAAA,IAAM,iBAAiB,GAAG;IACxB,OAAO,EAAE,UAAC,GAAW,IAAmB,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAClE,IAAI,CAAC;YACH,IAAM,KAAK,GAAkB,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC7D,OAAO,CAAC,KAAK,CAAC,CAAA;QAChB,CAAC;QAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAA;QACf,CAAC;IACH,CAAC,CAAC,EAPsC,CAOtC;IAEF,OAAO,EAAE,UAAC,GAAW,EAAE,KAAa,IAAK,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACnE,IAAI,CAAC;YACH,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YACvC,OAAO,CAAC,KAAK,CAAC,CAAA;QAChB,CAAC;QAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAA;QACf,CAAC;IACH,CAAC,CAAC,EAPuC,CAOvC;IAEF,UAAU,EAAE,UAAC,GAAW,IAAmB,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACrE,IAAI,CAAC;YACH,IAAM,KAAK,GAAkB,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC7D,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YACnC,OAAO,CAAC,KAAK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OAAO,EAAE,MAAM;QACxD,IAAI;YACF,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,CAAE,GAAG,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAE,EAAzC,CAAyC,CAAC,CAAA;YACzE,OAAO,CAAC,MAAM,CAAC,CAAA;SAChB;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,CAAA;SACd;IACH,CAAC,CAAC,EAP4B,CAO5B;IAEF,QAAQ,EAAE,UAAC,aAAyB,IAAK,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACnE,IAAI;YACF,aAAa,CAAC,OAAO,CAAC,UAAA,YAAY,IAAI,OAAA,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAA7D,CAA6D,CAAC,CAAA;YACpG,IAAM,gBAAgB,GAAG,aAAa,CAAC,GAAG,CAAC,UAAA,YAAY,IAAI,OAAA,CAAE,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAE,EAAjE,CAAiE,CAAC,CAAA;YAC7H,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC1B;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,CAAA;SACd;IACH,CAAC,CAAC,EARuC,CAQvC;CACH,CAAA;AAED,kBAAe,iBAAiB,CAAA"}
|
2
dist/actions.js.map
vendored
2
dist/actions.js.map
vendored
File diff suppressed because one or more lines are too long
13
dist/generate-require-signin-wrapper.js
vendored
13
dist/generate-require-signin-wrapper.js
vendored
|
@ -28,18 +28,23 @@ var generateRequireSignInWrapper = function (_a) {
|
|||
function GatedPage() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
GatedPage.prototype.componentWillMount = function () {
|
||||
var _a = this.props, history = _a.history, isSignedIn = _a.isSignedIn;
|
||||
if (!isSignedIn) {
|
||||
GatedPage.prototype.componentWillReceiveProps = function (nextProps) {
|
||||
var history = nextProps.history, hasVerificationBeenAttempted = nextProps.hasVerificationBeenAttempted, isSignedIn = nextProps.isSignedIn;
|
||||
if (hasVerificationBeenAttempted && !isSignedIn) {
|
||||
history.replace(redirectPathIfNotSignedIn);
|
||||
}
|
||||
};
|
||||
GatedPage.prototype.render = function () {
|
||||
return React.createElement(PageComponent, __assign({}, this.props));
|
||||
var _a = this.props, hasVerificationBeenAttempted = _a.hasVerificationBeenAttempted, isSignedIn = _a.isSignedIn;
|
||||
return (hasVerificationBeenAttempted && isSignedIn) ?
|
||||
React.createElement(PageComponent, __assign({}, this.props))
|
||||
:
|
||||
React.createElement("div", null);
|
||||
};
|
||||
return GatedPage;
|
||||
}(React.Component));
|
||||
var mapStateToProps = function (state) { return ({
|
||||
hasVerificationBeenAttempted: state.reduxTokenAuth.currentUser.hasVerificationBeenAttempted,
|
||||
isSignedIn: state.reduxTokenAuth.currentUser.isSignedIn
|
||||
}); };
|
||||
return react_redux_1.connect(mapStateToProps)(GatedPage);
|
||||
|
|
2
dist/generate-require-signin-wrapper.js.map
vendored
2
dist/generate-require-signin-wrapper.js.map
vendored
|
@ -1 +1 @@
|
|||
{"version":3,"file":"generate-require-signin-wrapper.js","sourceRoot":"","sources":["../src/generate-require-signin-wrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6BAA8B;AAE9B,2CAAqC;AAOrC,IAAM,4BAA4B,GAAG,UACnC,EAAiE;QAA/D,wDAAyB;IAE3B,IAAM,oBAAoB,GAAG,UAAC,aAA6B;QAQzD;YAAwB,6BAA6B;YAArD;;YAcA,CAAC;YAbQ,sCAAkB,GAAzB;gBACQ,IAAA,eAGQ,EAFZ,oBAAO,EACP,0BAAU,CACE;gBACd,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;oBAChB,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAA;gBAC5C,CAAC;YACH,CAAC;YAEM,0BAAM,GAAb;gBACE,MAAM,CAAC,oBAAC,aAAa,eAAK,IAAI,CAAC,KAAK,EAAI,CAAA;YAC1C,CAAC;YACH,gBAAC;QAAD,CAAC,AAdD,CAAwB,KAAK,CAAC,SAAS,GActC;QAED,IAAM,eAAe,GAAG,UAAC,KAAiB,IAAK,OAAA,CAAC;YAC9C,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU;SACxD,CAAC,EAF6C,CAE7C,CAAA;QAEF,MAAM,CAAC,qBAAO,CACZ,eAAe,CAChB,CAAC,SAAS,CAAC,CAAA;IACd,CAAC,CAAA;IAED,MAAM,CAAC,oBAAoB,CAAA;AAC7B,CAAC,CAAA;AAED,kBAAe,4BAA4B,CAAA"}
|
||||
{"version":3,"file":"generate-require-signin-wrapper.js","sourceRoot":"","sources":["../src/generate-require-signin-wrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6BAA8B;AAE9B,2CAAqC;AAOrC,IAAM,4BAA4B,GAAG,UACnC,EAAiE;QAA/D,wDAAyB;IAE3B,IAAM,oBAAoB,GAAG,UAAC,aAA6B;QASzD;YAAwB,6BAA6B;YAArD;;YAuBA,CAAC;YAtBQ,6CAAyB,GAAhC,UAAiC,SAAuB;gBAEpD,IAAA,2BAAO,EACP,qEAA4B,EAC5B,iCAAU,CACC;gBACb,IAAI,4BAA4B,IAAI,CAAC,UAAU,EAAE;oBAC/C,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAA;iBAC3C;YACH,CAAC;YAEM,0BAAM,GAAb;gBACQ,IAAA,eAGQ,EAFZ,8DAA4B,EAC5B,0BAAU,CACE;gBAEd,OAAO,CAAC,4BAA4B,IAAI,UAAU,CAAC,CAAC,CAAC;oBACnD,oBAAC,aAAa,eAAK,IAAI,CAAC,KAAK,EAAI;oBACjC,CAAC;wBACD,gCAAW,CAAC;YAChB,CAAC;YACH,gBAAC;QAAD,CAAC,AAvBD,CAAwB,KAAK,CAAC,SAAS,GAuBtC;QAED,IAAM,eAAe,GAAG,UAAC,KAAiB,IAAK,OAAA,CAAC;YAC9C,4BAA4B,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,4BAA4B;YAC3F,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU;SACxD,CAAC,EAH6C,CAG7C,CAAA;QAEF,OAAO,qBAAO,CACZ,eAAe,CAChB,CAAC,SAAS,CAAC,CAAA;IACd,CAAC,CAAA;IAED,OAAO,oBAAoB,CAAA;AAC7B,CAAC,CAAA;AAED,kBAAe,4BAA4B,CAAA"}
|
2
dist/reducers/current-user/index.js.map
vendored
2
dist/reducers/current-user/index.js.map
vendored
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/reducers/current-user/index.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qCAiBoB;AACpB,qDAA8C;AAG5C,IAAA,iDAAwB,CACV;AAEhB,IAAM,WAAW,GAAG,UAAC,KAAyB,EAAE,MAAmB;IAA9C,sBAAA,EAAA,mBAAyB;IAC5C,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACpB,KAAK,iCAAyB,CAAC;QAC/B,KAAK,iCAAyB,CAAC;QAC/B,KAAK,2BAAmB,CAAC;QACzB,KAAK,4BAAoB;YACvB,MAAM,cACD,KAAK,IACR,SAAS,EAAE,IAAI,IAChB;QACH,KAAK,sCAA8B;YACjC,MAAM,cACD,KAAK,IACR,UAAU,eAAO,MAAM,CAAC,OAAO,CAAC,cAAc,GAC9C,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,IAAI,EAChB,4BAA4B,EAAE,IAAI,IACnC;QACH,KAAK,sCAA8B,CAAC;QACpC,KAAK,gCAAwB;YAC3B,MAAM,cACD,KAAK,IACR,UAAU,eAAO,MAAM,CAAC,OAAO,CAAC,cAAc,GAC9C,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,IAAI,IACjB;QACH,KAAK,mCAA2B;YAC9B,MAAM,cACD,KAAK,IACR,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,KAAK,EACjB,4BAA4B,EAAE,IAAI,IACnC;QACH,KAAK,mCAA2B,CAAC;QACjC,KAAK,6BAAqB;YACxB,MAAM,cACD,KAAK,IACR,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,KAAK,IAClB;QACH,KAAK,iCAAyB;YAC5B,IAAM,iBAAiB,GAAa,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;YACjE,IAAM,qBAAqB,GAAmB,iBAAiB,CAAC,MAAM,CACpE,UAAC,6BAA6C,EAAE,uBAA+B;gBAC7E,MAAM,cACD,6BAA6B,eAC/B,uBAAuB,IAAG,IAAI,OAChC;;YACH,CAAC,EACD,EAAE,CACH,CAAA;YACD,MAAM,cACD,KAAK,IACR,UAAU,EAAE,qBAAqB,EACjC,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,KAAK,IAClB;QACH,KAAK,8BAAsB;YACzB,MAAM,cACD,KAAK,IACR,SAAS,EAAE,KAAK,IACjB;QACH,KAAK,2CAAmC;YACtC,MAAM,cACD,KAAK,IACR,4BAA4B,EAAE,MAAM,CAAC,OAAO,CAAC,4BAA4B,IAC1E;QACH;YACE,MAAM,CAAC,KAAK,CAAA;IAChB,CAAC;AACH,CAAC,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/reducers/current-user/index.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qCAiBoB;AACpB,qDAA8C;AAG5C,IAAA,iDAAwB,CACV;AAEhB,IAAM,WAAW,GAAG,UAAC,KAAyB,EAAE,MAAmB;IAA9C,sBAAA,EAAA,mBAAyB;IAC5C,QAAQ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AAE,MAAM,CAAC,OAAO,CAAC,4BAA4B,IAC1E;QACH;YACE,OAAO,KAAK,CAAA;KACf;AACH,CAAC,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
2
dist/services/auth.js.map
vendored
2
dist/services/auth.js.map
vendored
|
@ -1 +1 @@
|
|||
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/services/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBAuDA;;AAvDA,+BAAyB;AACzB,qCAAkD;AAQlD,IAAM,cAAc,GAAkB;IACpC,cAAc;IACd,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,KAAK;CACN,CAAA;AAEY,QAAA,cAAc,GAAG,UAAC,OAAoB;IACjD,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAEY,QAAA,iCAAiC,GAAG,UAAC,OAAsB,EAAE,OAAoB;IAC5F,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAEY,QAAA,iBAAiB,GAAG;IAC/B,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,OAAO,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAEY,QAAA,kCAAkC,GAAG,UAAO,OAAsB;;QAC7E,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;YACjC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QACzB,CAAC,CAAC,CAAA;;;KACH,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CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAEY,QAAA,iBAAiB,GAAG;IAC/B,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,OAAO,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAEY,QAAA,kCAAkC,GAAG,UAAO,OAAsB;;QAC7E,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;YACjC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QACzB,CAAC,CAAC,CAAA;;;KACH,CAAA;AAEY,QAAA,6BAA6B,GAAG,UAC3C,cAAoC,EACpC,QAAsB;IAEtB,IAAM,sBAAsB,GAAyB,gCAAsB,CAAC,cAAc,CAAC,CAAA;IAC3F,IAAM,yBAAyB,GAAa,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;IAC/E,IAAM,sBAAsB,GAAyB,EAAE,CAAA;IACvD,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAC,GAAW;QAClD,IAAI,yBAAyB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YACjD,sBAAsB,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SAC9E;IACH,CAAC,CAAC,CAAA;IACF,OAAO,sBAAsB,CAAA;AAC/B,CAAC,CAAA"}
|
2
dist/services/utility.js.map
vendored
2
dist/services/utility.js.map
vendored
|
@ -1 +1 @@
|
|||
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../../src/services/utility.ts"],"names":[],"mappings":";;AAEa,QAAA,sBAAsB,GAAG,UAAC,SAA+B;IACpE,IAAM,YAAY,GAAyB,EAAE,CAAA;IAC7C,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC;QAC1B,IAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;QAC1B,YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;IACzB,CAAC;IACD,MAAM,CAAC,YAAY,CAAA;AACrB,CAAC,CAAA"}
|
||||
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../../src/services/utility.ts"],"names":[],"mappings":";;AAEa,QAAA,sBAAsB,GAAG,UAAC,SAA+B;IACpE,IAAM,YAAY,GAAyB,EAAE,CAAA;IAC7C,KAAK,IAAI,GAAG,IAAI,SAAS,EAAE;QACzB,IAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;QAC1B,YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;KACxB;IACD,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA"}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "redux-token-auth",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"description": "Redux actions and reducers to integrate with Devise Token Auth",
|
||||
"main": "dist/index.js",
|
||||
"types": "index.d.ts",
|
||||
|
|
|
@ -12,6 +12,7 @@ const generateRequireSignInWrapper = (
|
|||
): RequireSignInWrapper => {
|
||||
const requireSignInWrapper = (PageComponent: ComponentClass): ComponentClass => {
|
||||
interface WrapperProps {
|
||||
readonly hasVerificationBeenAttempted: boolean
|
||||
readonly isSignedIn: boolean
|
||||
readonly history: {
|
||||
readonly replace: (path: string) => void
|
||||
|
@ -19,22 +20,32 @@ const generateRequireSignInWrapper = (
|
|||
}
|
||||
|
||||
class GatedPage extends React.Component<WrapperProps> {
|
||||
public componentWillMount (): void {
|
||||
public componentWillReceiveProps(nextProps: WrapperProps): void {
|
||||
const {
|
||||
history,
|
||||
hasVerificationBeenAttempted,
|
||||
isSignedIn,
|
||||
} = this.props
|
||||
if (!isSignedIn) {
|
||||
} = nextProps
|
||||
if (hasVerificationBeenAttempted && !isSignedIn) {
|
||||
history.replace(redirectPathIfNotSignedIn)
|
||||
}
|
||||
}
|
||||
|
||||
public render (): JSX.Element {
|
||||
return <PageComponent {...this.props} />
|
||||
const {
|
||||
hasVerificationBeenAttempted,
|
||||
isSignedIn,
|
||||
} = this.props
|
||||
|
||||
return (hasVerificationBeenAttempted && isSignedIn) ?
|
||||
<PageComponent {...this.props} />
|
||||
:
|
||||
<div></div>;
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: ReduxState) => ({
|
||||
hasVerificationBeenAttempted: state.reduxTokenAuth.currentUser.hasVerificationBeenAttempted,
|
||||
isSignedIn: state.reduxTokenAuth.currentUser.isSignedIn
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user