Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
fix: password form input field names (#22)
Browse files Browse the repository at this point in the history
* fix input field name

* flash message upon successful password change
  • Loading branch information
marianogoldman authored Nov 26, 2020
1 parent ddb142b commit f7032c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions resources/lang/en/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
'delete_account_title' => 'Delete Account',
'delete_account_description' => 'Deletion of the account will result in the loss of your data instantly and your account will be unrecoverable.',
'update_password_alert_description' => 'The Security Settings allow you to change your passwords and enable or disable 2FA. Please remember the changes made for when you next sign in.',
'password_updated' => 'Password was successfully updated',
],
];
9 changes: 6 additions & 3 deletions resources/views/profile/update-password-form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
<div class="my-8">
<x-ark-alert type="warning" :message="trans('fortify::pages.user-settings.update_password_alert_description')" />
</div>
<span class="header-4">@lang('fortify::pages.user-settings.password_information_title')</span>
<div>
<x-ark-flash />
</div>
<span class="mt-4 header-4">@lang('fortify::pages.user-settings.password_information_title')</span>
<span class="mt-4">@lang('fortify::forms.update-password.requirements_notice')</span>

<form class="mt-8" wire:submit.prevent="updatePassword">
<div class="space-y-4">
<x-ark-input type="password" name="currentPassword" model="state.current_password" :label="trans('fortify::forms.current_password')" :errors="$errors" />
<x-ark-input type="password" name="current_password" model="state.current_password" :label="trans('fortify::forms.current_password')" :errors="$errors" />

<x:ark-fortify::password-rules class="w-full" :password-rules="$passwordRules" is-typing="isTyping">
<x-ark-input type="password" name="password" model="state.password" class="w-full" :label="trans('fortify::forms.new_password')" @keydown="isTyping=true" :errors="$errors" />
</x:ark-fortify::password-rules>

<x-ark-input type="password" name="passwordConfirmation" model="state.password_confirmation" :label="trans('fortify::forms.confirm_password')" :errors="$errors" />
<x-ark-input type="password" name="password_confirmation" model="state.password_confirmation" :label="trans('fortify::forms.confirm_password')" :errors="$errors" />
</div>
<div class="flex sm:justify-end mt-8 w-full">
<button type="submit" class="button-secondary w-full sm:w-auto">@lang('fortify::actions.update')</button>
Expand Down
2 changes: 2 additions & 0 deletions src/Components/UpdatePasswordForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public function updatePassword(UpdatesUserPasswords $updater)
];

$this->emit('saved');

flash()->success(trans('fortify::pages.user-settings.password_updated'));
}

/**
Expand Down

0 comments on commit f7032c5

Please sign in to comment.