Skip to content

Commit 48db0e4

Browse files
committed
This is probably the correct way round
1 parent 7b72143 commit 48db0e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/rpi_auth/engine.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ class Engine < ::Rails::Engine
99

1010
using ::RpiAuthBypass
1111

12+
initializer 'RpiAuth.set_logger' do
13+
OmniAuth.config.logger = Rails.logger
14+
end
15+
1216
initializer 'RpiAuth.add_middleware' do |app|
1317
next unless RpiAuth.configuration
1418

@@ -40,8 +44,9 @@ class Engine < ::Rails::Engine
4044
end
4145

4246
config.after_initialize do
43-
OmniAuth.config.logger = Rails.logger
44-
RpiAuth.configuration&.enable_auth_bypass
47+
next unless RpiAuth.configuration
48+
49+
RpiAuth.configuration.enable_auth_bypass
4550
end
4651
end
4752
end

0 commit comments

Comments
 (0)