Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api not locked by default #189

Closed
bighoax opened this issue Mar 18, 2015 · 2 comments
Closed

Api not locked by default #189

bighoax opened this issue Mar 18, 2015 · 2 comments

Comments

@bighoax
Copy link

bighoax commented Mar 18, 2015

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?

@nicolas-besnard
Copy link
Contributor

@bighoax
Copy link
Author

bighoax commented Mar 23, 2015

thanks

@bighoax bighoax closed this as completed Mar 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants