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

Translations Issue: I18n::MissingTranslationData in Doorkeeper::Authorizations#new #1447

Closed sicktastic closed 3 years ago

sicktastic commented 3 years ago

Steps to reproduce

The Ruby on Rails application is the provider. We created an Oauth2 provider app in "/oauth/applications" with Name, Redirect URI, Confidential (checked), and nothing in the Scopes field.

Expected behavior

It should authorize the client application.

Actual behavior

I am getting this error, which seems like a translation issue during the authorization process (our rails app is the provider): I18n::MissingTranslationData in Doorkeeper::Authorizations#new translation missing: en.doorkeeper.scopes.read

https://github.com/doorkeeper-gem/doorkeeper/blob/c54e73115738edb5eb819147516592253198beeb/app/views/doorkeeper/authorizations/new.html.erb#L16

I haven't changed anything to my doorkeep.en.yml file, just followed the instruction to Rails installation process from the doc.

I have researched the issues and StackOverflow but didn't see any solutions.

System configuration

Doorkeeper initializer:

We are using Devise.

# config/initializers/doorkeeper.rb
Doorkeeper.configure do
  orm :active_record

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

  admin_authenticator do
    if current_user || warden.authenticate!(scope: :user)
      head :forbidden unless current_user.admin?
    else
      redirect_to root_path
    end
  end

  default_scopes :read
  optional_scopes :write

  enforce_configured_scopes
end

Ruby version: `` 2.6.3

Gemfile.lock:

Gemfile.lock content ``` GIT remote: https://github.com/antwonlee/uploadcare-rails revision: 838becf8292cd500b0288323c8af9f816597c9d5 specs: uploadcare-rails (1.2.1) rails (>= 4, < 6.1) uploadcare-ruby (~> 1.2) GEM remote: https://rubygems.org/ specs: actioncable (6.0.3.4) actionpack (= 6.0.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) actionmailbox (6.0.3.4) actionpack (= 6.0.3.4) activejob (= 6.0.3.4) activerecord (= 6.0.3.4) activestorage (= 6.0.3.4) activesupport (= 6.0.3.4) mail (>= 2.7.1) actionmailer (6.0.3.4) actionpack (= 6.0.3.4) actionview (= 6.0.3.4) activejob (= 6.0.3.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) actionpack (6.0.3.4) actionview (= 6.0.3.4) activesupport (= 6.0.3.4) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) actiontext (6.0.3.4) actionpack (= 6.0.3.4) activerecord (= 6.0.3.4) activestorage (= 6.0.3.4) activesupport (= 6.0.3.4) nokogiri (>= 1.8.5) actionview (6.0.3.4) activesupport (= 6.0.3.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) activejob (6.0.3.4) activesupport (= 6.0.3.4) globalid (>= 0.3.6) activemodel (6.0.3.4) activesupport (= 6.0.3.4) activerecord (6.0.3.4) activemodel (= 6.0.3.4) activesupport (= 6.0.3.4) activestorage (6.0.3.4) actionpack (= 6.0.3.4) activejob (= 6.0.3.4) activerecord (= 6.0.3.4) marcel (~> 0.3.1) activesupport (6.0.3.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) acts_as_votable (0.12.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) archive-zip (0.12.0) io-like (~> 0.3.0) ast (2.4.1) async (1.26.2) console (~> 1.0) nio4r (~> 2.3) timers (~> 4.1) async-io (1.30.1) async (~> 1.14) async-websocket (0.8.0) async-io websocket-driver (~> 0.7.0) autoprefixer-rails (10.0.1.0) execjs awesome_print (1.8.0) bcrypt (3.1.16) bindex (0.8.1) bitters (1.8.0) bourbon (~> 5.0) sass (~> 3.4) thor (~> 0.19) bootsnap (1.4.8) msgpack (~> 1.0) bourbon (5.1.0) sass (~> 3.4) thor (~> 0.19) builder (3.2.4) bullet (6.1.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) bundler-audit (0.7.0.1) bundler (>= 1.2.0, < 3) thor (>= 0.18, < 2) byebug (11.1.3) cancancan (3.1.0) capybara (3.33.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) capybara-selenium (0.0.6) capybara selenium-webdriver childprocess (3.0.0) chromedriver-helper (2.1.1) archive-zip (~> 0.10) nokogiri (~> 1.8) coderay (1.1.3) concurrent-ruby (1.1.7) connection_pool (2.2.3) console (1.9.0) contentful (2.15.4) http (> 0.8, < 5.0) multi_json (~> 1) countries (3.0.1) i18n_data (~> 0.10.0) sixarm_ruby_unaccent (~> 1.1) unicode_utils (~> 1.4) country_select (4.0.0) countries (~> 3.0) sort_alphabetical (~> 1.0) crack (0.4.4) crass (1.0.6) delayed_job (4.1.8) activesupport (>= 3.0, < 6.1) delayed_job_active_record (4.1.4) activerecord (>= 3.0, < 6.1) delayed_job (>= 3.0, < 5) devise (4.7.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) diff-lcs (1.4.4) docile (1.3.2) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) doorkeeper (5.4.0) railties (>= 5) dotenv (2.7.6) dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) erubi (1.9.0) execjs (2.7.0) factory_bot (6.1.0) activesupport (>= 5.0.0) factory_bot_rails (6.1.0) factory_bot (~> 6.1.0) railties (>= 5.0.0) faraday (0.17.3) multipart-post (>= 1.2, < 3) faraday_middleware (0.14.0) faraday (>= 0.7.4, < 1.0) ffi (1.13.1) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake formulaic (0.4.1) activesupport capybara i18n friendly_id (5.2.5) activerecord (>= 4.0.0) gli (2.19.2) globalid (0.4.2) activesupport (>= 4.2.0) groupdate (5.2.1) activesupport (>= 5) hashdiff (1.0.1) hashie (4.1.0) high_voltage (3.1.2) honeybadger (4.7.2) http (4.4.1) addressable (~> 2.3) http-cookie (~> 1.0) http-form_data (~> 2.2) http-parser (~> 1.2.0) http-cookie (1.0.3) domain_name (~> 0.5) http-form_data (2.3.0) http-parser (1.2.1) ffi-compiler (>= 1.0, < 2.0) i18n (1.8.5) concurrent-ruby (~> 1.0) i18n_data (0.10.0) inline_svg (1.7.1) activesupport (>= 3.0) nokogiri (>= 1.6) io-like (0.3.1) jbuilder (2.10.1) activesupport (>= 5.0.0) json (2.3.1) jwt (2.2.2) launchy (2.5.0) addressable (~> 2.7) listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) loofah (2.7.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) meta-tags (2.13.0) actionpack (>= 3.2.0, < 6.1) method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2020.0512) mimemagic (0.3.5) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.2) msgpack (1.3.3) multi_json (1.15.0) multipart-post (2.1.1) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) nio4r (2.5.4) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) oj (3.10.14) orm_adapter (0.5.0) pagy (3.8.3) parser (2.7.2.0) ast (~> 2.4.1) pg (1.2.3) 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 (4.0.6) puma (5.0.2) nio4r (~> 2.0) rack (2.2.3) rack-canonical-host (1.0.0) addressable (> 0, < 3) rack (>= 1.0.0, < 3) rack-mini-profiler (2.1.0) rack (>= 1.2.0) rack-protection (2.1.0) rack rack-proxy (0.6.5) rack rack-test (1.1.0) rack (>= 1.0, < 3) rack-timeout (0.6.0) rails (6.0.3.4) actioncable (= 6.0.3.4) actionmailbox (= 6.0.3.4) actionmailer (= 6.0.3.4) actionpack (= 6.0.3.4) actiontext (= 6.0.3.4) actionview (= 6.0.3.4) activejob (= 6.0.3.4) activemodel (= 6.0.3.4) activerecord (= 6.0.3.4) activestorage (= 6.0.3.4) activesupport (= 6.0.3.4) bundler (>= 1.3.0) railties (= 6.0.3.4) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) railties (6.0.3.4) actionpack (= 6.0.3.4) activesupport (= 6.0.3.4) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) rake (13.0.1) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) recipient_interceptor (0.2.0) mail redis (4.2.2) regexp_parser (1.8.1) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) restforce (4.2.2) faraday (>= 0.9.0, <= 1.0) faraday_middleware (>= 0.8.8, <= 1.0) hashie (>= 1.2.0, < 5.0) json (>= 1.7.5) jwt (>= 1.5.6) rspec-core (3.9.3) rspec-support (~> 3.9.3) rspec-expectations (3.9.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-mocks (3.9.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-rails (3.9.1) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) rspec-core (~> 3.9.0) rspec-expectations (~> 3.9.0) rspec-mocks (~> 3.9.0) rspec-support (~> 3.9.0) rspec-support (3.9.3) ruby2_keywords (0.0.2) rubyzip (2.3.0) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) 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 scout_apm (2.6.9) parser selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) semantic_range (2.3.0) shoulda-matchers (4.4.1) activesupport (>= 4.2.0) sidekiq (6.0.7) connection_pool (>= 2.2.2) rack (~> 2.0) rack-protection (>= 2.0.0) redis (>= 4.1.0) simple_form (5.0.3) actionpack (>= 5.0) activemodel (>= 5.0) simplecov (0.19.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov-html (0.12.3) sinatra (2.1.0) mustermann (~> 1.0) rack (~> 2.2) rack-protection (= 2.1.0) tilt (~> 2.0) sixarm_ruby_unaccent (1.2.0) slack-ruby-client (0.14.6) activesupport faraday (>= 0.9) faraday_middleware gli hashie websocket-driver sort_alphabetical (1.1.0) unicode_utils (>= 1.2.2) spring (2.1.1) spring-commands-rspec (1.0.4) spring (>= 0.9.1) sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.2) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) stripe (5.26.0) stripe_event (2.3.1) activesupport (>= 3.1) stripe (>= 2.8, < 6) suspenders (1.53.0) bitters (~> 1.7) rails (~> 6.0.0) thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) timecop (0.9.1) timers (4.3.2) tzinfo (1.2.7) thread_safe (~> 0.1) unf (0.1.4) unf_ext unf_ext (0.0.7.7) unicode_utils (1.4.0) uniform_notifier (1.13.0) uploadcare-ruby (1.2.2) faraday (~> 0.8) faraday_middleware (~> 0.9) mime-types multipart-post valid_email2 (3.4.0) activemodel (>= 3.2) mail (~> 2.5) validate_url (1.0.13) activemodel (>= 3.0.0) public_suffix warden (1.2.9) rack (>= 2.0.9) web-console (4.0.4) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) webmock (3.9.1) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) webpacker (5.2.1) activesupport (>= 5.2) rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) websocket-driver (0.7.3) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) wicked (1.3.4) railties (>= 3.0.7) xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.4.0) PLATFORMS ruby DEPENDENCIES acts_as_votable async-websocket (~> 0.8.0) autoprefixer-rails awesome_print bootsnap bullet bundler-audit (>= 0.5.0) cancancan capybara-selenium chromedriver-helper contentful country_select delayed_job_active_record devise doorkeeper dotenv-rails factory_bot_rails formulaic friendly_id (~> 5.2.4) groupdate high_voltage honeybadger inline_svg jbuilder jwt launchy listen meta-tags oj pagy pg pry-byebug pry-rails puma rack-canonical-host rack-mini-profiler rack-timeout rails (~> 6.0.0) recipient_interceptor restforce (~> 4.2.2) rspec-rails (~> 3.6) sassc-rails scout_apm shoulda-matchers sidekiq (= 6.0.7) simple_form simplecov sinatra slack-ruby-client spring spring-commands-rspec sprockets (>= 3.0.0) stripe stripe_event suspenders timecop tzinfo-data uploadcare-rails! valid_email2 validate_url web-console webmock webpacker wicked RUBY VERSION ruby 2.6.3p62 BUNDLED WITH 2.1.2 ```
sicktastic commented 3 years ago

I changed

config.action_view.raise_on_missing_translations = true

to

config.action_view.raise_on_missing_translations = false

in /config/environment/development.rb

and it worked. Regardless, are those translations missing?