Added route wants me to authenticate?

(Aedensixty) #1

I added a route through a plugin in my plugin.rb

post “/generate” => “discoursegen#generate”

which is running fine however when I do an ajax call on it the route wants me to use an api key? How can I set the route to be open access without auth?


(Matt Palmer) #2

skip_before_filter :ensure_logged_in in the controller should do it, assuming you want all endpoints of that controller to be unauth’d.

(Aedensixty) #3

That sorted it out. Cheers.

(Régis Hanol) #4