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

@authorize_with not working on specific action #79

Open
senconscious opened this issue Dec 8, 2022 · 0 comments
Open

@authorize_with not working on specific action #79

senconscious opened this issue Dec 8, 2022 · 0 comments

Comments

@senconscious
Copy link

Ruby 3.0
Rails 6.1.4

When trying to apply @authroize_with on specific controller action rather than whole controller, security not created in schema.

Base controller:

# @authorization [bearer] access_token jwt
class ApplicationController < ActionController::Base
end

Token controller:

# @resource Token
class TokensController < ApplicationController
##
# Sign in user
#
# @path [GET] /sign_in
 def sign_in
  render(json: {status: 'ok'})
 end

##
# Sign out user
#
# @path [GET] /sign_out
# @authorize_with access_token
 def sign_out
  render(json: {status: 'ok'})
 end 
end

But @authorize_with works if you will place it on controller thus security will be created and for all actions

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

1 participant