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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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...