I am doing a project for an elixir / phoenix framework. There was a question on authorization. For example, I have a route:
get "/dashboard", DashboardController, :index
I want only logged-in users to be able to go this route. As I present this process: the user goes along this route, it checks that the user is logged in. If yes, then the controller function that processes this route is called, if not, then a redirect to the login page occurs. Tell me, please, how to correctly implement this in phoenix framework? There can be many similar routes, I would like to have 1 handler for this.