File tree Expand file tree Collapse file tree 4 files changed +6
-13
lines changed
dummy/config/initializers Expand file tree Collapse file tree 4 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ class Configuration
2020 :user_model
2121
2222 def initialize
23- @brand = 'raspberrypi-org'
2423 @bypass_auth = false
2524 @response_type = :code
2625 @client_auth_method = :basic
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class Engine < ::Rails::Engine
1313 OmniAuth . config . logger = Rails . logger
1414 end
1515
16- initializer 'RpiAuth.add_middleware' do |app |
16+ initializer 'RpiAuth.add_middleware' do |app | # rubocop:disable Metrics/BlockLength
1717 next unless RpiAuth . configuration
1818
1919 app . middleware . use OmniAuth ::Builder do
@@ -36,18 +36,14 @@ class Engine < ::Rails::Engine
3636 jwks_uri : RpiAuth . configuration . jwks_uri
3737 } ,
3838 extra_authorize_params : { brand : RpiAuth . configuration . brand } ,
39- allow_authorize_params : [ :login_options ] ,
39+ allow_authorize_params : [ :login_options ] ,
4040 origin_param : 'returnTo'
4141 )
4242
4343 OmniAuth . config . on_failure = RpiAuth ::AuthController . action ( :failure )
44- end
45- end
4644
47- config . after_initialize do
48- next unless RpiAuth . configuration
49-
50- RpiAuth . configuration . enable_auth_bypass
45+ RpiAuth . configuration . enable_auth_bypass if RpiAuth . configuration . bypass_auth
46+ end
5147 end
5248 end
5349end
Original file line number Diff line number Diff line change 88 config . identity_url = 'http://localhost:3002'
99 config . user_model = 'User'
1010
11+ config . bypass_auth = false
12+
1113 # Profile is running in docker, so we need to set this manually. This
1214 # shouldn't be needed elsewhere, unless you're getting errors saying:
1315 # Invalid ID token: Issuer does not match
Original file line number Diff line number Diff line change 66 let ( :auth_url ) { 'https://auth.com:123/' }
77 let ( :auth_token_url ) { 'https://internal.auth.com:456' }
88
9- it 'sets a default value for brand' do
10- expect ( configuration . brand ) . to eq 'raspberrypi-org'
11- end
12-
139 it 'sets a default value for client_auth_method' do
1410 expect ( configuration . client_auth_method ) . to eq :basic
1511 end
You can’t perform that action at this time.
0 commit comments