Quantcast
Channel: How to restrict access to certain routes in Phoenix? - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Jason Harrelson for How to restrict access to certain routes in...

You could also define a separate pipeline for the authenticated endpoints:defmodule MyApp.Router do use MyApp.Web, :router pipeline :admin do plug :accepts, ["html"] plug Authentication # this...

View Article


Answer by Chris McCord for How to restrict access to certain routes in Phoenix?

You would use a plug in the UserController. 0.4.x has no ability for conditionally plug s, but you could achieve what you want with something like: defmodule MyApp.UserController do use...

View Article


How to restrict access to certain routes in Phoenix?

I have a small Phoenix application allowing users to login and consult their profile. I used the following simple route:resources "/users", MyApp.UserControllerBut this allows every user to see the...

View Article

Answer by tblev for How to restrict access to certain routes in Phoenix?

Building off of Chris Mccord you can actually do this without taking up a lot of space in the controller. Like this:defmodule MyAppWeb.CategoryController do use MyAppWeb, :controller use...

View Article
Browsing latest articles
Browse All 4 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>