Skip to content

Instantly share code, notes, and snippets.

@alexbeletsky
Created November 17, 2017 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbeletsky/c853f285fe398ad043b3c55045010d4d to your computer and use it in GitHub Desktop.
Save alexbeletsky/c853f285fe398ad043b3c55045010d4d to your computer and use it in GitHub Desktop.
_checkAndRedirect() {
const { dispatch, user } = this.props;
const { role, redirectTo } = options;
if (!user || !user.role === role) {
dispatch(push(redirectTo || '/signin'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment