Stop sign_in redirect for bad auth request, return 401 error instead

119 views
Skip to first unread message

Casey Gipson

unread,
Feb 27, 2013, 10:03:44 AM2/27/13
to plataforma...@googlegroups.com
I'm building a JSON API not using sessions only auth_token requests however if I hit a controller with before_filter :authenticate_user! devise tries to redirect me to a sign_in route that I've specified not to even include.

Are there any ways around this redirect that include returning a 401 if it is an unauthenticated request?

Casey Gipson

unread,
Feb 28, 2013, 12:11:15 PM2/28/13
to plataforma...@googlegroups.com
So, the issue was with some config settings that I mis-read.  

I needed to remove :json from navigation routes to prevent redirecting... 

All is well!
Reply all
Reply to author
Forward
0 new messages