doorkeeper-gem / doorkeeper

Doorkeeper is an OAuth 2 provider for Ruby on Rails / Grape.
https://doorkeeper.gitbook.io/guides/
MIT License
5.32k stars 1.07k forks source link

undefined method 'client' for nil:NilClass when inheriting from Doorkeeper::AuthorizationsController #1614

Closed matthewheathoyster closed 1 year ago

matthewheathoyster commented 1 year ago

Steps to reproduce

  1. Create a custom controller inheriting from Doorkeeper::AuthorizationsController and configure Doorkeeper routes to use it.
  2. Go to the new authorizations screen
  3. The error message will appear

Expected behavior

The pre_auth object should be loaded as expected.

Actual behavior

Inheriting from Doorkeeper::AuthorizationsController results in an error message of undefined method 'client' for nil:NilClass when attempting to load the view:

<main role="main">   
<p class="h4"> 
  <%= raw t('doorkeeper.authorizations.new.prompt', client_name: content_tag(:strong, class: 'text-info') { @pre_auth.client.name }) %>
</p>

Other things to note

If I copy the entire Doorkeeper::AuthorizationsController code into my custom controller, the pre_auth object works as expected, although I do have to adjust the pre_auth model from OAuth::PreAuthorization to Doorkeeper::OAuth::PreAuthorization but that's to be expected as part of namespacing.

It's not clear why an exact copy of the code works, but inheriting the controller doesn't.

System configuration

Doorkeeper initializer:

# config/initializers/doorkeeper.rb
# frozen_string_literal: true

Doorkeeper.configure do
  orm :active_record

  resource_owner_authenticator do
    current_user || warden.authenticate!(scope: :user)
  end

  access_token_class "PublicAPI::AccessToken"
  access_grant_class "PublicAPI::AccessGrant"
  application_class "PublicAPI::DeveloperApplication"

  enforce_content_type

  authorization_code_expires_in 10.minutes

  access_token_expires_in 2.hours

  base_controller 'ApplicationController'

  use_refresh_token

  enable_application_owner confirmation: false

  default_scopes
  optional_scopes :read_engagements, :read_payroll

  enforce_configured_scopes

  force_ssl_in_redirect_uri !Rails.env.development?

  allow_blank_redirect_uri false

  grant_flows %w[authorization_code]
end

Ruby version: ruby 3.1.2p20

Gemfile.lock:

Gemfile.lock content ``` GIT remote: https://github.com/heartcombo/devise.git revision: 025b1c873491908b346e4d394f54481ec18fb02c specs: devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) PATH remote: gems/argo specs: argo (0.1.0) activesupport webmock GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) aasm (5.2.0) concurrent-ruby (~> 1.0) actioncable (7.0.3.1) actionpack (= 7.0.3.1) activesupport (= 7.0.3.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) actionmailbox (7.0.3.1) actionpack (= 7.0.3.1) activejob (= 7.0.3.1) activerecord (= 7.0.3.1) activestorage (= 7.0.3.1) activesupport (= 7.0.3.1) mail (>= 2.7.1) net-imap net-pop net-smtp actionmailer (7.0.3.1) actionpack (= 7.0.3.1) actionview (= 7.0.3.1) activejob (= 7.0.3.1) activesupport (= 7.0.3.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) actionpack (7.0.3.1) actionview (= 7.0.3.1) activesupport (= 7.0.3.1) rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) actiontext (7.0.3.1) actionpack (= 7.0.3.1) activerecord (= 7.0.3.1) activestorage (= 7.0.3.1) activesupport (= 7.0.3.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) actionview (7.0.3.1) activesupport (= 7.0.3.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) activejob (7.0.3.1) activesupport (= 7.0.3.1) globalid (>= 0.3.6) activemodel (7.0.3.1) activesupport (= 7.0.3.1) activerecord (7.0.3.1) activemodel (= 7.0.3.1) activesupport (= 7.0.3.1) activestorage (7.0.3.1) actionpack (= 7.0.3.1) activejob (= 7.0.3.1) activerecord (= 7.0.3.1) activesupport (= 7.0.3.1) marcel (~> 1.0) mini_mime (>= 1.1.0) activesupport (7.0.3.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) administrate (0.17.0) actionpack (>= 5.0) actionview (>= 5.0) activerecord (>= 5.0) datetime_picker_rails (~> 0.0.7) jquery-rails (>= 4.0) kaminari (>= 1.0) momentjs-rails (~> 2.8) sassc-rails (~> 2.1) selectize-rails (~> 0.6) administrate-field-active_storage (0.4.1) administrate (>= 0.2.2) rails (>= 7.0) administrate-field-enum (0.0.9) administrate (~> 0.12) administrate-field-jsonb (0.4.6) administrate (< 1.0.0) rails (>= 4.2) administrate-field-nested_has_many (1.3.0) administrate (> 0.8, < 1) cocoon (~> 1.2, >= 1.2.11) afm (0.2.2) after_commit_everywhere (0.1.5) activerecord (>= 4.2) aggregate_root (2.4.1) ruby_event_store (= 2.4.1) airrecord (1.0.7) faraday (>= 0.10, < 2.0) net-http-persistent analytics-ruby (2.0.13) arkency-command_bus (0.4.1) concurrent-ruby ast (2.4.2) awesome_print (1.8.0) aws-eventstream (1.1.0) aws-partitions (1.418.0) aws-sdk-core (3.111.2) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) aws-sdk-kms (1.41.0) aws-sdk-core (~> 3, >= 3.109.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.87.0) aws-sdk-core (~> 3, >= 3.109.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) aws-sigv4 (1.2.2) aws-eventstream (~> 1, >= 1.0.2) backport (1.2.0) bcrypt (3.1.16) benchmark (0.2.0) bindex (0.8.1) bootsnap (1.11.1) msgpack (~> 1.2) brpoplpush-redis_script (0.1.2) concurrent-ruby (~> 1.0, >= 1.0.5) redis (>= 1.0, <= 5.0) builder (3.2.4) bundle-audit (0.1.0) bundler-audit bundler-audit (0.9.1) bundler (>= 1.2.0, < 3) thor (~> 1.0) byebug (11.1.3) capybara (3.37.1) addressable matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) capybara-lockstep (1.2.1) activesupport (>= 3.2) capybara (>= 2.0) ruby2_keywords selenium-webdriver (>= 3) childprocess (4.1.0) cocoon (1.2.15) code_owners (2.0.1) pathspec rake coderay (1.1.3) combine_pdf (1.0.22) matrix ruby-rc4 (>= 0.1.5) concurrent-ruby (1.1.10) config (3.1.0) deep_merge (~> 1.2, >= 1.2.1) dry-validation (~> 1.0, >= 1.0.0) connection_pool (2.2.5) cookiejar (0.3.3) countries (5.1.0) sixarm_ruby_unaccent (~> 1.1) crack (0.4.5) rexml crass (1.0.6) datadog_api_client (2.1.0) httparty (~> 0.20, >= 0.20.0) zeitwerk (~> 2.6, >= 2.6.0) datetime_picker_rails (0.0.7) momentjs-rails (>= 2.8.1) db-query-matchers (0.11.0) activesupport (>= 4.0, < 7.1) rspec (>= 3.0) ddtrace (1.5.0) debase-ruby_core_source (>= 0.10.16, <= 0.10.17) libdatadog (~> 0.7.0.1.1) libddwaf (~> 1.3.0.2.0) msgpack debase-ruby_core_source (0.10.17) declarative (0.0.20) deep_merge (1.2.1) devise-pwned_password (0.1.9) devise (~> 4) pwned (~> 2.0.0) diff-lcs (1.5.0) digest (3.1.0) docile (1.3.5) docusign_esign (3.19.0) addressable (~> 2.7, >= 2.7.0) json (~> 2.1, >= 2.1.0) jwt (~> 2.2, >= 2.2.1) typhoeus (~> 1.0, >= 1.0.1) dogstatsd-ruby (5.5.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) doorkeeper (5.6.2) railties (>= 5) dotenv (2.7.6) dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) dry-cli (0.7.0) dry-configurable (0.13.0) concurrent-ruby (~> 1.0) dry-core (~> 0.6) dry-container (0.9.0) concurrent-ruby (~> 1.0) dry-configurable (~> 0.13, >= 0.13.0) dry-core (0.7.1) concurrent-ruby (~> 1.0) dry-inflector (0.2.1) dry-initializer (3.0.4) dry-logic (1.2.0) concurrent-ruby (~> 1.0) dry-core (~> 0.5, >= 0.5) dry-schema (1.8.0) concurrent-ruby (~> 1.0) dry-configurable (~> 0.13, >= 0.13.0) dry-core (~> 0.5, >= 0.5) dry-initializer (~> 3.0) dry-logic (~> 1.0) dry-types (~> 1.5) dry-types (1.5.1) concurrent-ruby (~> 1.0) dry-container (~> 0.3) dry-core (~> 0.5, >= 0.5) dry-inflector (~> 0.1, >= 0.1.2) dry-logic (~> 1.0, >= 1.0.2) dry-validation (1.7.0) concurrent-ruby (~> 1.0) dry-container (~> 0.7, >= 0.7.1) dry-core (~> 0.5, >= 0.5) dry-initializer (~> 3.0) dry-schema (~> 1.8, >= 1.8.0) e2mmap (0.1.0) em-http-request (1.1.7) addressable (>= 2.3.4) cookiejar (!= 0.3.1) em-socksify (>= 0.3) eventmachine (>= 1.0.3) http_parser.rb (>= 0.6.0) em-socksify (0.3.2) eventmachine (>= 1.0.0.beta.4) em-synchrony (1.0.6) eventmachine (>= 1.0.0.beta.1) erubi (1.11.0) et-orbi (1.2.6) tzinfo ethon (0.15.0) ffi (>= 1.15.0) eventmachine (1.2.7) eventmachine_httpserver (0.2.1) factory_bot (6.2.0) activesupport (>= 5.0.0) factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) faker (2.20.0) i18n (>= 1.8.11, < 2) faraday (1.10.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) faraday-httpclient (~> 1.0) faraday-multipart (~> 1.0) faraday-net_http (~> 1.0) faraday-net_http_persistent (~> 1.0) faraday-patron (~> 1.0) faraday-rack (~> 1.0) faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-httpclient (1.0.1) faraday-multipart (1.0.3) multipart-post (>= 1.2, < 3) faraday-net_http (1.0.1) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) faraday_middleware (1.0.0) faraday (~> 1.0) fast_excel (0.4.0) ffi (> 1.9, < 2) ffi (1.15.5) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake formatador (1.1.0) fugit (1.5.2) et-orbi (~> 1.1, >= 1.1.8) raabro (~> 1.4) globalid (1.0.0) activesupport (>= 5.0) gon (6.4.0) actionpack (>= 3.0.20) i18n (>= 0.7) multi_json request_store (>= 1.0) good_migrations (0.2.1) activerecord (>= 3.1) railties (>= 3.1) google-apis-core (0.3.0) addressable (~> 2.5, >= 2.5.1) googleauth (~> 0.14) httpclient (>= 2.8.1, < 3.0) mini_mime (~> 1.0) representable (~> 3.0) retriable (>= 2.0, < 4.0) rexml signet (~> 0.14) webrick google-apis-drive_v3 (0.8.0) google-apis-core (~> 0.1) google-protobuf (3.21.7) googleauth (0.16.2) faraday (>= 0.17.3, < 2.0) jwt (>= 1.4, < 3.0) memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (~> 0.14) graphql (2.0.14) graphql-batch (0.5.1) graphql (>= 1.10, < 3) promise.rb (~> 0.7.2) graphql-pagination (2.0.1) graphql (~> 2.0) graphql-rails_logger (1.2.3) actionpack (> 5.0) activesupport (> 5.0) railties (> 5.0) rouge (~> 3.0) guard (2.18.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) pry (>= 0.13.0) shellany (~> 0.0) thor (>= 0.18.1) guard-compat (1.2.1) guard-rspec (4.7.3) guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) guard-rubocop (1.5.0) guard (~> 2.0) rubocop (< 2.0) hairtrigger (0.2.25) activerecord (>= 5.0, < 8) ruby2ruby (~> 2.4) ruby_parser (~> 3.10) hashdiff (1.0.1) hashery (2.1.2) hashie (4.1.0) hellosign-ruby-sdk (3.7.7) faraday mime-types multi_json http (5.1.0) addressable (~> 2.8) http-cookie (~> 1.0) http-form_data (~> 2.2) llhttp-ffi (~> 0.4.0) http-cookie (1.0.5) domain_name (~> 0.5) http-form_data (2.3.0) http_parser.rb (0.6.0) httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) httpclient (2.8.3) hubspot-api-client (14.5.2) json (~> 2.1, >= 2.1.0) require_all (~> 3.0.0) typhoeus (~> 1.4.0) i18n (1.12.0) concurrent-ruby (~> 1.0) ibandit (1.9.0) i18n ice_nine (0.11.2) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) inflection (1.0.0) intercom-rails (0.4.2) activesupport (> 3.0) jaro_winkler (1.5.4) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) jmespath (1.6.1) jquery-rails (4.5.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.6.2) json-schema (2.8.1) addressable (>= 2.4) jwt (2.2.2) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) kaminari-activerecord (= 1.2.2) kaminari-core (= 1.2.2) kaminari-actionview (1.2.2) actionview kaminari-core (= 1.2.2) kaminari-activerecord (1.2.2) activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) knapsack (4.0.0) rake kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) launchdarkly-server-sdk (6.4.0) concurrent-ruby (~> 1.1) http (>= 4.4.0, < 6.0.0) json (~> 2.3) ld-eventsource (= 2.2.1) semantic (~> 1.6) ld-eventsource (2.2.1) concurrent-ruby (~> 1.0) http (>= 4.4.1, < 6.0.0) libdatadog (0.7.0.1.1) libddwaf (1.3.0.2.0) ffi (~> 1.0) licensed (3.5.0) bundler (>= 1.10) licensee (>= 9.15.2, < 10.0.0) parallel (>= 0.18.0) pathname-common_prefix (~> 0.0.1) reverse_markdown (>= 1, < 3) ruby-xxHash (~> 0.4) thor (>= 0.19) tomlrb (>= 1.2, < 3.0) licensee (9.15.2) dotenv (~> 2.0) octokit (~> 4.20) reverse_markdown (~> 1.0) rugged (>= 0.24, < 2.0) thor (>= 0.19, < 2.0) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) llhttp-ffi (0.4.0) ffi-compiler (~> 1.0) rake (~> 13.0) lograge (0.11.2) actionpack (>= 4) activesupport (>= 4) railties (>= 4) request_store (~> 1.0) loofah (2.19.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.2.8) mail (2.7.1) mini_mime (>= 0.1.1) marcel (1.0.2) matrix (0.4.2) memoist (0.16.2) method_source (1.0.0) mime-types (3.4.1) mime-types-data (~> 3.2015) mime-types-data (3.2022.0105) mini_magick (4.11.0) mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.16.3) momentjs-rails (2.29.1.1) railties (>= 3.1) monetize (1.12.0) money (~> 6.12) money (6.16.0) i18n (>= 0.6.4, <= 2) money-rails (1.15.0) activesupport (>= 3.0) monetize (~> 1.9) money (~> 6.13) railties (>= 3.0) msgpack (1.6.0) multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.1.1) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) nenv (0.3.0) net-http-persistent (4.0.1) connection_pool (~> 2.2) net-imap (0.2.3) digest net-protocol strscan net-pop (0.1.1) digest net-protocol timeout net-protocol (0.1.3) timeout net-smtp (0.3.1) digest net-protocol timeout nio4r (2.5.8) nokogiri (1.13.9) mini_portile2 (~> 2.8.0) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) oauth2 (1.4.4) faraday (>= 0.8, < 2.0) jwt (>= 1.0, < 3.0) multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) octokit (4.22.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) omniauth (2.0.2) hashie (>= 3.4.6) rack (>= 1.6.2, < 3) rack-protection omniauth-google-oauth2 (0.8.1) jwt (>= 2.0) oauth2 (~> 1.1) omniauth (>= 1.1.1) omniauth-oauth2 (>= 1.6) omniauth-oauth2 (1.7.1) oauth2 (~> 1.4) omniauth (>= 1.9, < 3) omniauth-okta (2.0.0) omniauth (~> 2.0) omniauth-oauth2 (~> 1.7, >= 1.7.1) omniauth-rails_csrf_protection (1.0.0) actionpack (>= 4.2) omniauth (~> 2.0) orm_adapter (0.5.0) os (1.1.1) paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) parallel (1.22.1) parallel_tests (3.8.1) parallel paranoia (2.6.0) activerecord (>= 5.1, < 7.1) parser (3.1.2.1) ast (~> 2.4.1) pathname-common_prefix (0.0.1) pathspec (1.1.3) pdf-core (0.9.0) pdf-inspector (1.3.0) pdf-reader (>= 1.0, < 3.0.a) pdf-reader (2.10.0) Ascii85 (~> 1.0) afm (~> 0.2.1) hashery (~> 2.0) ruby-rc4 ttfunk pg (1.3.4) phone (1.2.3) plaid (13.0.0) faraday faraday_middleware hashie (>= 3.4.3) possessive (1.0.1) postmark (1.22.0) json postmark-rails (0.22.0) actionmailer (>= 3.0.0) postmark (>= 1.21.3, < 2.0) prawn (2.4.0) pdf-core (~> 0.9.0) ttfunk (~> 1.7) prawn-table (0.2.2) prawn (>= 1.3.0, < 3.0.0) promise.rb (0.7.4) pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) pry-byebug (3.9.0) byebug (~> 11.0) pry (~> 0.13.0) pry-rails (0.3.9) pry (>= 0.10.4) public_suffix (5.0.0) puffing-billy (3.0.2) addressable (~> 2.5) em-http-request (~> 1.1, >= 1.1.0) em-synchrony eventmachine (~> 1.2) eventmachine_httpserver http_parser.rb (~> 0.6.0) multi_json puma (5.6.4) nio4r (~> 2.0) pwned (2.0.2) raabro (1.4.0) racc (1.6.0) rack (2.2.4) rack-attack (6.6.1) rack (>= 1.0, < 3) rack-cors (1.1.1) rack (>= 2.0.0) rack-protection (3.0.4) rack rack-proxy (0.7.2) rack rack-test (2.0.2) rack (>= 1.3) rack-timeout (0.6.0) rails (7.0.3.1) actioncable (= 7.0.3.1) actionmailbox (= 7.0.3.1) actionmailer (= 7.0.3.1) actionpack (= 7.0.3.1) actiontext (= 7.0.3.1) actionview (= 7.0.3.1) activejob (= 7.0.3.1) activemodel (= 7.0.3.1) activerecord (= 7.0.3.1) activestorage (= 7.0.3.1) activesupport (= 7.0.3.1) bundler (>= 1.15.0) railties (= 7.0.3.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.3) loofah (~> 2.3) rails_event_store (2.4.1) activejob (>= 3.0) activemodel (>= 3.0) activesupport (>= 3.0) aggregate_root (= 2.4.1) arkency-command_bus (>= 0.4) rails_event_store_active_record (= 2.4.1) ruby_event_store (= 2.4.1) ruby_event_store-browser (= 2.4.1) rails_event_store_active_record (2.4.1) activerecord (>= 6.0) ruby_event_store (= 2.4.1) railties (7.0.3.1) actionpack (= 7.0.3.1) activesupport (= 7.0.3.1) method_source rake (>= 12.2) thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) redis (4.6.0) redis-namespace (1.8.2) redis (>= 3.0.4) regexp_parser (2.6.0) representable (3.1.1) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) request_store (1.5.1) rack (>= 1.4) require_all (3.0.0) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) retriable (3.1.2) reverse_markdown (1.4.0) nokogiri rexml (3.2.5) roo (2.9.0) nokogiri (~> 1) rubyzip (>= 1.3.0, < 3.0.0) rouge (3.30.0) rspec (3.11.0) rspec-core (~> 3.11.0) rspec-expectations (~> 3.11.0) rspec-mocks (~> 3.11.0) rspec-core (3.11.0) rspec-support (~> 3.11.0) rspec-expectations (3.11.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.11.0) rspec-github (2.3.1) rspec-core (~> 3.0) rspec-github-actions-formatter (0.2.0) rspec-mocks (3.11.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.11.0) rspec-rails (5.1.1) actionpack (>= 5.2) activesupport (>= 5.2) railties (>= 5.2) rspec-core (~> 3.10) rspec-expectations (~> 3.10) rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.11.0) rspec_junit_formatter (0.5.1) rspec-core (>= 2, < 4, != 2.12.0) rubocop (1.27.0) parallel (~> 1.10) parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml rubocop-ast (>= 1.16.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.23.0) parser (>= 3.1.1.0) rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rails (2.14.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) rubocop-rspec (2.10.0) rubocop (~> 1.19) ruby-calendarific (1.0.1) ruby-progressbar (1.11.0) ruby-rc4 (0.1.5) ruby-vips (2.1.4) ffi (~> 1.12) ruby-xxHash (0.4.0.2) ruby2_keywords (0.0.5) ruby2ruby (2.4.4) ruby_parser (~> 3.1) sexp_processor (~> 4.6) rubyXL (3.4.24) nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) ruby_event_store (2.4.1) concurrent-ruby (~> 1.0, >= 1.1.6) ruby_event_store-browser (2.4.1) ruby_event_store (= 2.4.1) sinatra ruby_event_store-rspec (2.4.1) rspec (~> 3.0) ruby_parser (3.19.0) sexp_processor (~> 4.16) rubyzip (2.3.2) rufus-scheduler (3.8.1) fugit (~> 1.1, >= 1.1.6) rugged (1.4.2) sassc (2.4.0) ffi (~> 1.9) sassc-rails (2.1.2) railties (>= 4.0.0) sassc (>= 2.0) sprockets (> 3.0) sprockets-rails tilt sawyer (0.8.2) addressable (>= 2.3.5) faraday (> 0.8, < 2.0) scenic (1.6.0) activerecord (>= 4.0.0) railties (>= 4.0.0) scientist (1.6.3) selectize-rails (0.12.6) selenium-webdriver (4.6.1) childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) semantic (1.6.1) sentry-rails (5.2.0) railties (>= 5.0) sentry-ruby-core (~> 5.2.0) sentry-ruby (5.2.0) concurrent-ruby (~> 1.0, >= 1.0.2) sentry-ruby-core (= 5.2.0) sentry-ruby-core (5.2.0) concurrent-ruby sentry-sidekiq (5.2.0) sentry-ruby-core (~> 5.2.0) sidekiq (>= 3.0) sexp_processor (4.16.0) shellany (0.0.1) shoulda-matchers (5.1.0) activesupport (>= 5.2.0) sidekiq (6.4.1) connection_pool (>= 2.2.2) rack (~> 2.0) redis (>= 4.2.0) sidekiq-failures (1.0.1) sidekiq (>= 4.0.0) sidekiq-scheduler (3.1.1) e2mmap redis (>= 3, < 5) rufus-scheduler (~> 3.2) sidekiq (>= 3) thwait tilt (>= 1.4.0) sidekiq-unique-jobs (7.1.15) brpoplpush-redis_script (> 0.1.1, <= 2.0.0) concurrent-ruby (~> 1.0, >= 1.0.5) sidekiq (>= 5.0, < 8.0) thor (>= 0.20, < 3.0) signet (0.15.0) addressable (~> 2.3) faraday (>= 0.17.3, < 2.0) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) simplecov (0.21.2) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.2) sinatra (3.0.4) mustermann (~> 3.0) rack (~> 2.2, >= 2.2.4) rack-protection (= 3.0.4) tilt (~> 2.0) sixarm_ruby_unaccent (1.2.0) slack-notifier (2.4.0) solargraph (0.47.2) backport (~> 1.2) benchmark bundler (>= 1.17.2) diff-lcs (~> 1.4) e2mmap jaro_winkler (~> 1.5) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.1) parser (~> 3.0) reverse_markdown (>= 1.0.5, < 3) rubocop (>= 0.52) thor (~> 1.0) tilt (~> 2.0) yard (~> 0.9, >= 0.9.24) spring (3.1.1) spring-commands-rspec (1.0.4) spring (>= 0.9.1) sprockets (4.1.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) standard (1.10.0) rubocop (= 1.27.0) rubocop-performance (= 1.13.3) stripe (5.30.0) strong_migrations (1.1.0) activerecord (>= 5.2) strscan (3.0.3) thor (1.2.1) thwait (0.2.0) e2mmap tilt (2.0.11) timeout (0.3.0) tomlrb (2.0.1) trailblazer-option (0.1.1) ttfunk (1.7.0) typhoeus (1.4.0) ethon (>= 0.9.0) tzinfo (2.0.5) concurrent-ruby (~> 1.0) tzinfo-data (1.2022.3) tzinfo (>= 1.0.0) uber (0.1.0) unf (0.1.4) unf_ext unf_ext (0.0.8.2) unicode-display_width (2.3.0) vcr (6.1.0) vite_rails (3.0.9) railties (>= 5.1, < 8) vite_ruby (~> 3.0) vite_ruby (3.1.6) dry-cli (~> 0.7.0) rack-proxy (~> 0.6, >= 0.6.1) zeitwerk (~> 2.2) warden (1.2.9) rack (>= 2.0.9) web-console (4.2.0) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) webdrivers (5.2.0) nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0) webmock (3.18.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) webrick (1.7.0) websocket (1.2.9) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) wisper (2.0.1) wisper-rspec (1.1.0) write_xlsx (1.09.3) rubyzip (>= 1.0.0) zip-zip xpath (3.2.0) nokogiri (~> 1.8) yard (0.9.28) webrick (~> 1.7.0) zeitwerk (2.6.1) zendesk_api (1.35.0) faraday (>= 0.9.0, < 2.0.0) hashie (>= 3.5.2, < 6.0.0) inflection mini_mime multipart-post (~> 2.0) zip-zip (0.3) rubyzip (>= 1.0.0) PLATFORMS ruby DEPENDENCIES aasm (~> 5.0, >= 5.2.0) administrate administrate-field-active_storage administrate-field-enum administrate-field-jsonb administrate-field-nested_has_many after_commit_everywhere (~> 0.1, >= 0.1.5) analytics-ruby (~> 2.0.0) argo! awesome_print aws-sdk-s3 bootsnap (>= 1.4.2) brain! bundle-audit byebug capybara (>= 2.15) capybara-lockstep codat! code_owners combine_pdf config connection_pool countries datadog_api_client (~> 2.1.0) db-query-matchers ddtrace (~> 1.0) dealer! devise! devise-pwned_password dogstatsd-ruby doorkeeper (~> 5.6) dotenv-rails expensify! factory_bot_rails faker fast_excel fugit gon good_migrations google-apis-drive_v3 google-protobuf (~> 3.21) graphql graphql-batch graphql-pagination graphql-rails_logger guard guard-rspec guard-rubocop hairtrigger hellosign-ruby-sdk httparty hubspot-api-client ibandit (~> 1.9.0) ice_nine (~> 0.11.2) image_processing intercom-rails json-schema (~> 2.8) kaminari-activerecord knapsack launchdarkly-server-sdk licensed lograge mail matrix money money-rails multipart-post (~> 2.1) net-imap net-pop net-smtp omniauth omniauth-google-oauth2 omniauth-okta omniauth-rails_csrf_protection paper_trail parallel_tests paranoia pdf-inspector pg (>= 0.18, < 2.0) phone plaid (~> 13.0.0) possessive (~> 1.0, >= 1.0.1) postmark-rails prawn prawn-table pry-byebug pry-rails puffing-billy puma (~> 5.6) rack-attack rack-cors rack-timeout rails (~> 7.0.2) rails-controller-testing rails_event_store rainbow redis redis-namespace roo (~> 2.9.0) rspec-github rspec-github-actions-formatter rspec-rails (~> 5.1.0) rspec-retry rspec_junit_formatter rubocop rubocop-rails rubocop-rspec (~> 2.8) ruby-calendarific (~> 1.0) rubyXL (>= 3.4.24, < 4.0) rubyzip scenic scientist selenium-webdriver sentry-rails sentry-ruby sentry-sidekiq shoulda-matchers sidekiq-failures sidekiq-pro! sidekiq-scheduler sidekiq-unique-jobs simplecov slack-notifier solargraph spring (~> 3.1) spring-commands-rspec standard (~> 1.10) stripe (~> 5.30.0) strong_migrations tzinfo-data vcr vite_rails web-console (>= 3.3.0) webdrivers webmock (>= 3.18.1) wisper (~> 2.0.1) wisper-rspec (~> 1.1) write_xlsx (~> 1.09) zendesk_api RUBY VERSION ruby 3.1.2p20 BUNDLED WITH 4.3.7 ```
nbulaj commented 1 year ago

Hi @matthewheath

Sorry, I couldn't find such view in Doorkeeper gem which contains view code you proposed. Is it something custom?

I do have to adjust the pre_auth model from OAuth::PreAuthorization to Doorkeeper::OAuth::PreAuthorization

Didn't get this.. We have only Doorkeeper::OAuth::PreAuthorization PORO, not sure what do you mean by OAuth::PreAuthorization model.

Also pre auth has a client instance only after attributes validation (especially client_id):

https://github.com/doorkeeper-gem/doorkeeper/blob/main/lib/doorkeeper/oauth/pre_authorization.rb#L85-L88

So in your case it could be null if no Client ID specified with the request.

matthewheathoyster commented 1 year ago

Didn't get this.. We have only Doorkeeper::OAuth::PreAuthorization PORO, not sure what do you mean by OAuth::PreAuthorization model.

Sorry, that is my mistake. By "model" I simply mean PORO.

In any event, this alleged bug was my own mistake - I was accidentally overwriting some of the inherited controller methods when I didn't need to. All I needed to do was set a custom layout and write my own views to override the default ones. :-)

I'm closing this issue.