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

Simplify TokenInfoController to be overridable (extract response rendering) #1482

Merged
merged 1 commit into from
Feb 6, 2021

Conversation

nbulaj
Copy link
Member

@nbulaj nbulaj commented Feb 6, 2021

Now you can override response(s) for Doorkeeper::TokenInfoController with more elegant way:

class TokenInfoController < Doorkeeper::TokenInfoController
  protected

  def doorkeeper_token_to_json
    {}
  end

  def error_to_json(error)
    {}
  end
end

# config/routes.rb
Rails.application.routes.draw do
  use_doorkeeper do
    controllers token_info: 'token_info_controller'
  end
end

Relates to #1466

@nbulaj nbulaj added this to the 5.5 milestone Feb 6, 2021
@nbulaj nbulaj linked an issue Feb 6, 2021 that may be closed by this pull request
@doorkeeper-bot
Copy link

1 Warning
⚠️ There're library changes, but not tests. That's OK as long as you're refactoring existing code.

Generated by 🚫 Danger

@nbulaj nbulaj merged commit eb6ed6e into master Feb 6, 2021
@nbulaj nbulaj deleted the simplify-token-info-customization branch February 6, 2021 11:34
Copy link

@Chasemycharlie Chasemycharlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of #

Copy link

@Chasemycharlie Chasemycharlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

Possibility to customize the response of oauth/token/info
3 participants