Skip to content

Commit

Permalink
Pull onelogin test details from const
Browse files Browse the repository at this point in the history
This allows us some controller if we want to stub this in our tests
  • Loading branch information
rjlynch committed Oct 31, 2024
1 parent b42070c commit c3e203c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/controllers/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3e203c

Please sign in to comment.