我有一个非常标准的身份验证方法
private
def authenticate_user
@current_user = User.find_by_authentication_token(params[:token])
unless @current_user
error = { :error => "Invalid token." }
respond_with(error, :status => 401 )
end
end
我正在调用 API 以确保身份验证失败。
我收到一条错误消息
ArgumentError (Nil location provided. Can't build URI.):
app/controllers/api/v1/base_controller.rb:13:in `authenticate_user'
我究竟做错了什么?