From 2b359caa0aa11e54c4c936c2de66e2a1c3ab7410 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Wed, 16 Aug 2017 09:09:52 +0300 Subject: [PATCH] Improve routing changes - Add hash to saved from page - Use authPage instead of preferLogin for more flexibility --- src/Routes.js | 7 +++---- src/routesConfiguration.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Routes.js b/src/Routes.js index 3565dd37..0fa7ca4f 100644 --- a/src/Routes.js +++ b/src/Routes.js @@ -54,12 +54,11 @@ class RouteComponentRenderer extends Component { render() { const { route, match, location, staticContext, flattenedRoutes } = this.props; - const { component: RouteComponent, preferLogin = false } = route; + const { component: RouteComponent, authPage = 'SignupPage' } = route; const canShow = this.canShowComponent(); if (!canShow) { staticContext.forbidden = true; } - const authPageName = preferLogin ? 'LoginPage' : 'SignupPage'; return canShow ? : ; } } diff --git a/src/routesConfiguration.js b/src/routesConfiguration.js index b675a90c..2dd3b39b 100644 --- a/src/routesConfiguration.js +++ b/src/routesConfiguration.js @@ -309,7 +309,7 @@ const routesConfiguration = [ { path: '/email_verification', auth: true, - preferLogin: true, + authPage: 'LoginPage', exact: true, name: 'EmailVerificationPage', component: props => ,