From b6e45490ed89c5125127e53559891ff91524d2e1 Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Wed, 30 Oct 2024 13:38:37 +0000 Subject: [PATCH] Pull onelogin test details from const This allows us some controller if we want to stub this in our tests --- app/controllers/omniauth_callbacks_controller.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 13e003510a..d9066c84d4 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -114,11 +114,17 @@ def process_one_login_identity_verification_callback(core_identity_jwt) ) end + ONE_LOGIN_TEST_USER = { + first_name: "TEST", + last_name: "USER", + date_of_birth: Date.new(1970, 1, 1) + } + def extract_data_from_jwt(jwt) if OneLoginSignIn.bypass? - first_name = "TEST" - last_name = "USER" - date_of_birth = Date.new(1970, 1, 1) + first_name = ONE_LOGIN_TEST_USER[:first_name] + last_name = ONE_LOGIN_TEST_USER[:last_name] + date_of_birth = ONE_LOGIN_TEST_USER[:date_of_birth] else validator = OneLogin::CoreIdentityValidator.new(jwt:) validator.call