Prevent accessing route if logged in

Is it possible to prevent a user from accessing a page if already logged in? I remember vanilla Phoenix having something like :redirect_if_user_authenticated but I can't find the Ash way to achieve this.
Solution:
You could do it at the router level, but you could also add a policy on the action
Jump to solution
3 Replies
Solution
ZachDaniel
ZachDaniel3w ago
You could do it at the router level, but you could also add a policy on the action
ZachDaniel
ZachDaniel3w ago
forbid_if actor_present()
Yahya Oxley
Yahya OxleyOP3w ago
Thank you

Did you find this page helpful?