reactjs - React Authentication -
looking add login page app, there aren't date tutorials react or react-router.
thinking passport js, , having reroute react app upon successful authentication.
thoughts? there better way?
you can protect routes onenter
callback
reactdom.render( ( <provider store={store}> <router history={browserhistory}> <route path="/" component={nav} > <indexroute component={home}/> <route path='/customers' component={customers} onenter={signin}/> <route path='/vendors' component={vendors} onenter={signin}/> </router> </provider> ), document.getelementbyid('reactentry'));
in signin
function, need check if user can log in. if not, display error message
also, here example: https://developer.okta.com/blog/2017/03/30/react-okta-sign-in-widget
Comments
Post a Comment