diff --git a/modules/accredited_representative_portal/app/services/accredited_representative_portal/representative_user_loader.rb b/modules/accredited_representative_portal/app/services/accredited_representative_portal/representative_user_loader.rb index 7a7a93bac16..da0e51f3dc1 100644 --- a/modules/accredited_representative_portal/app/services/accredited_representative_portal/representative_user_loader.rb +++ b/modules/accredited_representative_portal/app/services/accredited_representative_portal/representative_user_loader.rb @@ -31,8 +31,7 @@ def validate_account_and_session end def loa - current_loa = user_is_verified? ? SignIn::Constants::Auth::LOA_THREE : SignIn::Constants::Auth::LOA_ONE - { current: current_loa, highest: SignIn::Constants::Auth::LOA_THREE } + { current: SignIn::Constants::Auth::LOA_THREE, highest: SignIn::Constants::Auth::LOA_THREE } end def sign_in @@ -42,20 +41,8 @@ def sign_in end def authn_context - case user_verification.credential_type - when SignIn::Constants::Auth::IDME - user_is_verified? ? SignIn::Constants::Auth::IDME_LOA3 : SignIn::Constants::Auth::IDME_LOA1 - when SignIn::Constants::Auth::DSLOGON - user_is_verified? ? SignIn::Constants::Auth::IDME_DSLOGON_LOA3 : SignIn::Constants::Auth::IDME_DSLOGON_LOA1 - when SignIn::Constants::Auth::MHV - user_is_verified? ? SignIn::Constants::Auth::IDME_MHV_LOA3 : SignIn::Constants::Auth::IDME_MHV_LOA1 - when SignIn::Constants::Auth::LOGINGOV - user_is_verified? ? SignIn::Constants::Auth::LOGIN_GOV_IAL2 : SignIn::Constants::Auth::LOGIN_GOV_IAL1 - end - end - - def user_is_verified? - session.user_account.verified? + user_verification.credential_type == SignIn::Constants::Auth::IDME ? SignIn::Constants::Auth::IDME_LOA3 : + SignIn::Constants::Auth::LOGIN_GOV_IAL2 end def session @@ -93,7 +80,7 @@ def current_user user.logingov_uuid = user_verification.logingov_uuid user.ogc_number = ogc_number # TODO-ARF 80297: Determine how to get ogc_number into RepresentativeUserLoader user.poa_codes = get_poa_codes - user.idme_uuid = user_verification.idme_uuid || user_verification.backing_idme_uuid + user.idme_uuid = user_verification.idme_uuid user.last_signed_in = session.created_at user.sign_in = sign_in user.save