See my comment in the NoMethodError handler
# `access_token_mixin.rb`
def generate_token
self.created_at ||= Time.now.utc
generator = Doorkeeper.configuration.access_token_generator.constantize
self.token = generator.generate(
resource_owner_id: resource_owner_id,
scopes: scopes,
application: application,
expires_in: expires_in,
created_at: created_at
)
rescue NoMethodError
# Doorkeeper::JWT was trying to use `[]` on a null variable and thus a NoMethodError was raised. The error message returned here in this case was misleading because Doorkeeper::JWT does in fact respond to `.generate`
raise Errors::UnableToGenerateToken, "#{generator} does not respond to `.generate`."
rescue NameError
raise Errors::TokenGeneratorNotFound, "#{generator} not found"
end
See my comment in the
NoMethodErrorhandler