You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do I lock certain or all api methods so that the user needs to provide correct credentials before being able to reach the method. My example is this :
class ApplicationController < ActionController::API
include ActionController::MimeResponds
include DeviseTokenAuth::Concerns::SetUserByToken
end
Then my api controller :
class TestController < ApplicationController
def test_method
render :text => '"TEST"'
rescue => e
Rails.logger.error "Stack trace:\n#{e.backtrace.map {|l| " #{l}\n"}.join}"
render :nothing => true, status: 500
end
end
I can get to test method from rest client, no authentication needed. What am I doing wrong?
The text was updated successfully, but these errors were encountered:
How do I lock certain or all api methods so that the user needs to provide correct credentials before being able to reach the method. My example is this :
class ApplicationController < ActionController::API
include ActionController::MimeResponds
include DeviseTokenAuth::Concerns::SetUserByToken
end
Then my api controller :
class TestController < ApplicationController
def test_method
render :text => '"TEST"'
rescue => e
Rails.logger.error "Stack trace:\n#{e.backtrace.map {|l| " #{l}\n"}.join}"
render :nothing => true, status: 500
end
end
I can get to test method from rest client, no authentication needed. What am I doing wrong?
The text was updated successfully, but these errors were encountered: