Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class ProfileController < ApplicationController
class AccountsController < ApplicationController
before_action :confirm_two_factor_authenticated
layout 'card_wide'

def index
def show
cacher = Pii::Cacher.new(current_user, user_session)

@view_model = ProfileIndex.new(
@view_model = AccountShow.new(
decrypted_pii: cacher.fetch,
personal_key: flash[:personal_key],
decorated_user: current_user.decorate
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def after_sign_in_path_for(user)
end

def signed_in_path
user_fully_authenticated? ? profile_path : user_two_factor_authentication_path
user_fully_authenticated? ? account_path : user_two_factor_authentication_path
end

def reauthn_param
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/concerns/two_factor_authenticatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def current_password_required?
def check_already_authenticated
return unless initial_authentication_context?

redirect_to profile_path if user_fully_authenticated?
redirect_to account_path if user_fully_authenticated?
end

def reset_attempt_count_if_user_no_longer_locked_out
Expand Down Expand Up @@ -195,11 +195,11 @@ def after_otp_action_path
user_session[:first_time_personal_key_view] = 'true'
sign_up_personal_key_path
elsif @updating_existing_number
profile_path
account_path
elsif decorated_user.password_reset_profile.present?
reactivate_profile_path
else
profile_path
account_path
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/unconfirmed_user_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def after_confirmation_path_for(user)
if !user_signed_in?
new_user_session_url
elsif user.two_factor_enabled?
profile_path
account_path
else
phone_setup_url
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sign_up/email_confirmations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def process_already_confirmed_user
action_text = 'Please sign in.' unless user_signed_in?
flash[:error] = t('devise.confirmations.already_confirmed', action: action_text)

redirect_to user_signed_in? ? profile_path : new_user_session_url
redirect_to user_signed_in? ? account_path : new_user_session_url
end

def unsuccessful_confirmation_error
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/emails_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def process_updates
flash[:notice] = t('devise.registrations.email_update_needs_confirmation')
end

redirect_to profile_url
redirect_to account_url
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/users/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def handle_success
bypass_sign_in current_user

flash[:personal_key] = @update_user_password.personal_key
redirect_to profile_url, notice: t('notices.password_changed')
redirect_to account_url, notice: t('notices.password_changed')
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/users/personal_keys_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def next_step
if current_user.decorate.password_reset_profile.present?
reactivate_profile_url
else
profile_url
account_url
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/phones_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def process_updates
flash[:notice] = t('devise.registrations.phone_update_needs_confirmation')
prompt_to_confirm_phone(phone: @update_user_phone_form.phone)
else
redirect_to profile_url
redirect_to account_url
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/reactivate_profile_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def index
def create
@reactivate_profile_form = build_reactivate_profile_form
if @reactivate_profile_form.submit(flash)
redirect_to profile_path
redirect_to account_path
else
render :index
end
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/users/totp_setup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class TotpSetupController < ApplicationController
before_action :confirm_two_factor_authenticated

def new
return redirect_to profile_path if current_user.totp_enabled?
return redirect_to account_path if current_user.totp_enabled?

user_session[:new_totp_secret] = current_user.generate_totp_secret if new_totp_secret.nil?

Expand All @@ -29,14 +29,14 @@ def disable
UpdateUser.new(user: current_user, attributes: { otp_secret_key: nil }).call
flash[:success] = t('notices.totp_disabled')
end
redirect_to profile_path
redirect_to account_path
end

private

def process_valid_code
flash[:success] = t('notices.totp_configured')
redirect_to profile_path
redirect_to account_path
user_session.delete(:new_totp_secret)
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/users/verify_profile_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def index
def create
@verify_profile_form = build_verify_profile_form
if @verify_profile_form.submit
flash[:success] = t('profile.index.verification.success')
redirect_to profile_path
flash[:success] = t('account.index.verification.success')
redirect_to account_path
else
render :index
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/verify/confirmations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def next_step
end

def confirm_profile_has_been_created
redirect_to profile_path if idv_session.profile.blank?
redirect_to account_path if idv_session.profile.blank?
end

def track_final_idv_event
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/verify/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def step
end

def handle_idv_redirect
redirect_to profile_path and return if current_user.personal_key.present?
redirect_to account_path and return if current_user.personal_key.present?
redirect_to manage_personal_key_path
end

Expand Down
2 changes: 1 addition & 1 deletion app/decorators/user_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def recent_events

def verified_account_partial
if identity_verified?
'profile/verified_account_badge'
'accounts/verified_account_badge'
else
'shared/null'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def fallback_links

def cancel_link
if reauthn
profile_path
account_path
else
destroy_user_session_path
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def fallback_links

def cancel_link
if confirmation_for_phone_change || reauthn
profile_path
account_path
else
destroy_user_session_path
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ProfileIndex
class AccountShow
attr_reader :decorated_user, :decrypted_pii, :personal_key

def initialize(decrypted_pii:, personal_key:, decorated_user:)
Expand All @@ -9,53 +9,53 @@ def initialize(decrypted_pii:, personal_key:, decorated_user:)

def header_partial
if decorated_user.identity_verified?
'profile/verified_header'
'accounts/verified_header'
else
'profile/header'
'accounts/header'
end
end

def personal_key_partial
if personal_key.present?
'profile/personal_key'
'accounts/personal_key'
else
'shared/null'
end
end

def password_reset_partial
if decorated_user.password_reset_profile.present?
'profile/password_reset'
'accounts/password_reset'
else
'shared/null'
end
end

def pending_profile_partial
if decorated_user.pending_profile.present?
'profile/pending_profile'
'accounts/pending_profile'
else
'shared/null'
end
end

def edit_action_partial
'profile/actions/edit_action_button'
'accounts/actions/edit_action_button'
end

def pii_partial
if decrypted_pii.present?
'profile/pii'
'accounts/pii'
else
'shared/null'
end
end

def totp_partial
if decorated_user.totp_enabled?
'profile/actions/disable_totp'
'accounts/actions/disable_totp'
else
'profile/actions/enable_totp'
'accounts/actions/enable_totp'
end
end

Expand All @@ -64,15 +64,15 @@ def manage_personal_key_partial
end

def personal_key_action_partial
'profile/actions/manage_personal_key'
'accounts/actions/manage_personal_key'
end

def personal_key_item_partial
'profile/personal_key_item_heading'
'accounts/personal_key_item_heading'
end

def recent_event_partial
'profile/event_item'
'accounts/event_item'
end

def header_personalization
Expand All @@ -82,9 +82,9 @@ def header_personalization
end

def totp_content
return 'profile.index.auth_app_enabled' if decorated_user.totp_enabled?
return 'account.index.auth_app_enabled' if decorated_user.totp_enabled?

'profile.index.auth_app_disabled'
'account.index.auth_app_disabled'
end

delegate :recent_events, to: :decorated_user
Expand Down
2 changes: 1 addition & 1 deletion app/view_models/verify/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def button
class: button_css_classes
)
else
helper.link_to button_link_text, profile_path, class: button_css_classes
helper.link_to button_link_text, account_path, class: button_css_classes
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
h2.h3.m0.center.sm-left-align
.sm-hide.regular.sans-serif.inline
span
= t('profile.welcome')
= t('account.welcome')
',
p.mb0.bold
= view_model.header_personalization
span.sm-show
= t('headings.profile.login_info')
= t('headings.account.login_info')

.px2.pb1.bold.h3.sm-hide.serif
= t('headings.profile.login_info')
= t('headings.account.login_info')
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nav.bg-white
width: 170), root_path
.right-align.col.col-5
span.sm-display-inline-block.display-none.border-right.border-silver.pr1
= t('profile.welcome')
= t('account.welcome')
'
span.bold = greeting
= link_to t('links.sign_out'), destroy_user_session_path,
Expand Down
3 changes: 3 additions & 0 deletions app/views/accounts/_password_reset.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mb4.alert.alert-warning
p = t('account.index.reactivation.instructions')
p.mb0 = link_to t('account.index.reactivation.reactivate_button'), reactivate_profile_path
3 changes: 3 additions & 0 deletions app/views/accounts/_pending_profile.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mb4.alert.alert-warning
p = t('account.index.verification.instructions')
p.mb0 = link_to t('account.index.verification.reactivate_button'), verify_profile_path
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.col
= image_tag asset_url('p-key.svg'), width: 16, class: 'mr1 align-middle'
= t('profile.items.personal_key')
= t('account.items.personal_key')
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.mb3.profile-info-box
.bg-light-blue.py1.px2.h6.caps.clearfix
.col.col-11
= t('headings.profile.profile_info')
= t('headings.account.profile_info')
= image_tag asset_url('user.svg'), width: 8, class: 'ml1 mt-tiny'
.col.col-1.right-align
= image_tag asset_url('lock.svg'), width: 8, class: 'mr1'
.p2
.clearfix.mxn1
.sm-col.sm-col-4.px1.bold = t('profile.index.full_name')
.sm-col.sm-col-4.px1.bold = t('account.index.full_name')
.sm-col.sm-col-8.px1.truncate #{decrypted_pii.first_name} #{decrypted_pii.last_name}

.p2.border-top
.clearfix.mxn1
.sm-col.sm-col-4.px1.bold = t('profile.index.address')
.sm-col.sm-col-4.px1.bold = t('account.index.address')
.sm-col.sm-col-8.px1
| #{decrypted_pii.address1}<br>
- if decrypted_pii.address2.present?
Expand All @@ -21,21 +21,21 @@

.p2.border-top
.clearfix.mxn1
.sm-col.sm-col-4.px1.bold = t('profile.index.dob')
.sm-col.sm-col-4.px1.bold = t('account.index.dob')
.sm-col.sm-col-8.px1 #{decrypted_pii.dob.to_date.to_formatted_s(:long)}

.p2.border-top
.clearfix.mxn1
.sm-col.sm-col-4.px1.bold = t('profile.index.ssn')
.sm-col.sm-col-4.px1.bold = t('account.index.ssn')
.sm-col.sm-col-8.px1 = "***-**-#{decrypted_pii.ssn.raw[-4..-1]}"

.p2.border-top.border-bottom
.clearfix.mxn1
.sm-col.sm-col-4.px1.bold = t('profile.index.phone')
.sm-col.sm-col-4.px1.bold = t('account.index.phone')
.sm-col.sm-col-8.px1 = decrypted_pii.phone

.bg-gray-lighter.px2.py1.clearfix.fs-12p
.col.col-12.sm-col-6
= image_tag asset_url('lock.svg'), width: 8, class: 'mr1'
= t('profile.security.text')
= link_to t('profile.security.link'), MarketingSite.help_url
= t('account.security.text')
= link_to t('account.security.link'), MarketingSite.help_url
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
.verification-badge.mx-auto
span
= image_tag asset_url('alert/success.svg'), width: 16, class: 'mr1 align-middle'
= t('headings.profile.verified_account')
= t('headings.account.verified_account')
Loading