You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently ran into an issue with decorators. I have the following code (modified for simplification):
class RecipesView(FlaskView):
decorators = [login_required]
def before_request(self, name, id=None, **kwargs):
print(current_user.full_name)
def index(self):
# do something
login_required using Flask-Security-Too/Flask-Login
And getting an error when an unlogged user goes to /recipes. They shouldn't get there, and they won't, but before_request runs nevertheless, raising error and not getting redirect to /login.
So, is class definition of decorators not applied to before__method_ ? I didn't find that in docs, and it doesn't make much sense in my opinion. Or am I doing something wrong?
Thanks for help and clarification :)
The text was updated successfully, but these errors were encountered:
I recently ran into an issue with decorators. I have the following code (modified for simplification):
login_required
using Flask-Security-Too/Flask-LoginAnd getting an error when an unlogged user goes to
/recipes
. They shouldn't get there, and they won't, butbefore_request
runs nevertheless, raising error and not getting redirect to/login
.So, is class definition of decorators not applied to
before__method_
? I didn't find that in docs, and it doesn't make much sense in my opinion. Or am I doing something wrong?Thanks for help and clarification :)
The text was updated successfully, but these errors were encountered: