I made a decorator function taht checks if the user is logged in or and redirects them if they're not. When redirected, an error message is displayed in login.html if the variable 'needLogin' is set in the url.
The decorator is called on every on all route the user would normally access once logged in. Thus, it is not anymore necessary to check manually inside the functions if the user is logged in or not.
I made a decorator function taht checks if the user is logged in or and redirects them if they're not. When redirected, an error message is displayed in login.html if the variable 'needLogin' is set in the url. The decorator is called on every on all route the user would normally access once logged in. Thus, it is not anymore necessary to check manually inside the functions if the user is logged in or not.