maxmantz / redux-oidc-example

Small ReactJS application to demonstrate the usage of redux-oidc
MIT License
108 stars 68 forks source link

Authenticate on all routes - Question #26

Open PurpleMonkeyWrench opened 4 years ago

PurpleMonkeyWrench commented 4 years ago

How would you modify this example to authenticate the user on all routes?

So if the application where setup with a Main Page, Page 1, Page 2, and Page 3, each with it's own route, how could you make it so if the user wanted to enter the application on Page 1 it would redirect to a login page and then direct them back to Page 1 once they've logged in?

Is it recommended that on each route you would need to do a check to see if the user is logged in or is there a better DRY principled way to do it?