Я использую devity authenticate_user! метод в контроллере. Это нормально работает, когда auth_token, предоставленный в запросе, является правильным, но если аутентификация завершается неудачно, я получаю:
curl -XGET 'http://localhost:3000/my_obj?auth_token=wrongtoken'
<html><body>You are being <a href="#" onclick="location.href='http://localhost:3000/users/sign_in'; return false;">redirected</a>.</body></html>
Как я использую rabl, лучший способ иметь что-то вроде
{'error' : 'authentication error'}
вернулся с перенаправлением html?