Skip to content

Commit

Permalink
Fix reset link in notif
Browse files Browse the repository at this point in the history
  • Loading branch information
dvlpp committed Oct 13, 2023
1 parent 24c7cda commit a05adc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Http/ForgotPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Password;
use Illuminate\Validation\ValidationException;
use Inertia\Inertia;
use Inertia\Response;

Expand Down
8 changes: 8 additions & 0 deletions src/SharpServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Code16\Sharp\View\Components\Content;
use Code16\Sharp\View\Components\File;
use Code16\Sharp\View\Components\Image;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Inertia\ServiceProvider as InertiaServiceProvider;
Expand All @@ -44,6 +45,13 @@ public function boot()

if (config('sharp.auth.forgotten_password.enabled')) {
$this->loadRoutesFrom(__DIR__.'/routes/auth/forgotten_password.php');

ResetPassword::createUrlUsing(function ($user, string $token) {
return route('code16.sharp.password.reset', [
'token' => $token,
'email' => ($user->email ?? null),
]);
});
}

$this->loadViewsFrom(__DIR__.'/../resources/views', 'sharp');
Expand Down

0 comments on commit a05adc3

Please sign in to comment.