Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRY Up the Authorization #4

Open
calebthewood opened this issue Jul 10, 2022 · 0 comments
Open

DRY Up the Authorization #4

calebthewood opened this issue Jul 10, 2022 · 0 comments

Comments

@calebthewood
Copy link
Owner

This will be more advanced.
In many routes, there are a few lines that check for is-a-user-logged-in. You could solve this by writing your own “decorator”, like “@app.route”, but that checks if the g.user object is not null and, if not, flashes and redirects.

You’ll need to do some searching and reading about Python decorators to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant