Created
October 9, 2017 04:52
-
-
Save mattmazzola/dcad539b3a32e389e1870f60b8e677c1 to your computer and use it in GitHub Desktop.
authentication required
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tslint:disable-next-line:no-any | |
const userIsAuthenticated = connectedRouterRedirect<any, State>({ | |
// The url to redirect user to if they fail | |
redirectPath: '/login', | |
// Determine if the user is authenticated or not | |
authenticatedSelector: state => state.user.isLoggedIn, | |
// A nice display name for this check | |
wrapperDisplayName: 'UserIsAuthenticated' | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment