Reputation: 42093
I'd like to write a simple decorator that I can put above functions in my controller to check authentication and re-direct to the login page if the current user is not authenticated. What is the best way to do this? Where should the decorator go? How should I pass cookie info to the decorator? Sample code is greatly appreciated.
Thank you!
Upvotes: 2
Views: 534
Reputation: 3121
Another approach for authorization in pylons (decorator based, repoze.what like)
How should I pass cookie info to the decorator?
Use a global request object and get cookie or use wsgi environ of the request
Upvotes: 2