Skip to content

Commit

Permalink
🐛 Fix bug on reset password mail (laravelcm#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts authored Jul 1, 2023
1 parent 34b6844 commit 42348ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ public function boot(): void
{
$this->registerPolicies();

ResetPassword::createUrlUsing(fn ($user, string $token) => config('lcm.spa_url').'/auth/password/reset?token='.$token);
if (request()->ajax()) {
ResetPassword::createUrlUsing(
callback: fn ($user, string $token) => config('lcm.spa_url').'/auth/password/reset?token='.$token
);
}

Gate::before(fn ($user) => $user->hasRole('admin') ? true : null);
}
Expand Down

0 comments on commit 42348ec

Please sign in to comment.