lib/gds-sso/warden_config.rb in gds-sso-9.0.0 vs lib/gds-sso/warden_config.rb in gds-sso-9.1.0

- old
+ new

@@ -167,10 +167,10 @@ ::GDS::SSO::ApiAccess.api_call?(env) end def authenticate! logger.debug("Authenticating with mock_gds_sso_api_access strategy") - dummy_api_user = GDS::SSO::Config.user_klass.find_by_email("dummyapiuser@domain.com") + dummy_api_user = GDS::SSO.test_user || GDS::SSO::Config.user_klass.find_by_email("dummyapiuser@domain.com") if dummy_api_user.nil? dummy_api_user = GDS::SSO::Config.user_klass.create!( uid: "#{rand(10000)}", name: "Dummy API user created by gds-sso", permissions: ["signin"],