lib/gds-sso/warden_config.rb in gds-sso-9.2.0 vs lib/gds-sso/warden_config.rb in gds-sso-9.2.1

- old
+ new

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