Skip to content

Commit

Permalink
Merge pull request jeffgreco13#115 from Saifallak/patch-1
Browse files Browse the repository at this point in the history
use custom reset broker for reset passwords.
  • Loading branch information
jeffgreco13 authored Oct 19, 2022
2 parents 175819c + 219be6d commit 727e1dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion config/filament-breezy.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,19 @@
"users_table" => "users",
/*
|--------------------------------------------------------------------------
| The reset broker to be used in your reset password requests
*/
"reset_broker" => config("auth.defaults.passwords"),
/*
|--------------------------------------------------------------------------
| The column to use for login/username authentication. NOTE: this may change to just 'login_field' in a later release.
*/
"fallback_login_field" => "email",
/*
|--------------------------------------------------------------------------
| Set a route name prefix for all of Breezy's auth routes. Ex. set filament. to prefix all route names, filament.register. WARNING: if you use a custom route prefix, you'll need to override the default auth routes used throughout your application. This is outside of Breezy's scope and will be up to the dev to maintain. Use at your own risk. See example: https://laravel.com/docs/9.x/passwords#password-customization
*/
"route_group_prefix"=>'',
"route_group_prefix" => '',
/*
|--------------------------------------------------------------------------
| Enable Two-Factor Authentication (2FA).
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Livewire/Auth/ResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function submit()
$data = $this->form->getState();

if ($this->isResetting) {
$response = Password::reset([
$response = Password::broker(config('filament-breezy.reset_broker', config('auth.defaults.passwords')))->reset([
'token' => $this->token,
'email' => $this->email,
'password' => $data['password'],
Expand All @@ -82,7 +82,7 @@ public function submit()
Notification::make()->title(__("filament-breezy::default.reset_password.notification_error"))->persistent()->actions([NotificationAction::make('resetAgain')->label(__("filament-breezy::default.reset_password.notification_error_link_text"))->url(route(config('filament-breezy.route_group_prefix').'password.request'))])->danger()->send();
}
} else {
$response = Password::sendResetLink(['email' => $this->email]);
$response = Password::broker(config('filament-breezy.reset_broker', config('auth.defaults.passwords')))->sendResetLink(['email' => $this->email]);
if ($response == Password::RESET_LINK_SENT) {
Notification::make()->title(__("filament-breezy::default.reset_password.notification_success"))->success()->send();

Expand Down

0 comments on commit 727e1dd

Please sign in to comment.