sapper-authentication-demo icon indicating copy to clipboard operation
sapper-authentication-demo copied to clipboard

added protection for routes

Open primavera133 opened this issue 5 years ago • 2 comments

I noticed your routes were not protected, just the in-template-ifs in the navigation menu. Added a way of protecting the routes both in the server and for clientside navigation. I had to add a redirect-function to polka as well. Also I ran 'npm audit fix'

primavera133 avatar May 05 '20 20:05 primavera133

Thanks for this. In the talk I mention a plugin I created for this purpose which is a cleaner way to do the same thing. How do you feel about us using the @beyonk/sapper-rbac plugin instead?

My feeling is that without the plugin, the code starts to become extremely complicated.

antony avatar May 06 '20 10:05 antony

Ah, right! I’ll check that out.

primavera133 avatar May 06 '20 15:05 primavera133