Skip to content

Commit

Permalink
♻️ Ensure users cannot register on their own
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyf committed Oct 12, 2023
1 parent de418e7 commit f25a2eb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hyrax-webapp
12 changes: 12 additions & 0 deletions lib/hyku_knapsack/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ def self.load_translations!

config.before_initialize do
config.i18n.load_path += Dir["#{config.root}/config/locales/**/*.yml"]

if Hyku::Application.respond_to?(:user_devise_parameters=)
Hyku::Application.user_devise_parameters = %i[
database_authenticatable
invitable
recoverable
rememberable
trackable
validatable
omniauthable
]
end
end

##
Expand Down
6 changes: 6 additions & 0 deletions spec/hyku_knapsack/engine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
require 'spec_helper'

RSpec.describe HykuKnapsack::Engine do
describe 'Devise configuration' do
subject { Devise.mappings[:user] }

it { is_expected.not_to be_registerable }
end

describe 'I18n.load_path' do
it 'has HykuKnapsack translations at a higher precendence than Hyku translations' do
hyku_root = Rails.root.to_s
Expand Down

0 comments on commit f25a2eb

Please sign in to comment.