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
Do you have a way to redirect if the condition is not met?
Yes, you can use the Is.xxx tests with an if condition in your route to return a redirect(…). There's no easy way I know to include this redirection in the current decorators, but you can create your own if you need to.
Did you have the case that the condition is set before the response? In this case {% auth %} doesn't work.
I'm not sure to understand the question, could you please give an example?
{% auth 'app.home' %
Don't show me because this route is protected by
the decorator @allow_if(Is.drunk) which is called before the request.
{% endauth %}
Oh, I don't think I've met this situation in my use cases. You will probably need to create another decorator (instead of allow_if) that adds the auth condition to all your routes.
This is an elegant plugin, thank you.
Do you have a way to redirect if the condition is not met?
Did you have the case that the condition is set before the response? In this case {% auth %} doesn't work.
The text was updated successfully, but these errors were encountered: