feat: reset password

This commit is contained in:
2026-05-21 21:09:54 +02:00
parent eda0ffd199
commit 7f60bc756f
10 changed files with 238 additions and 0 deletions
+11
View File
@@ -5,6 +5,7 @@ namespace App\Providers;
use App\Broadcasting\ExpoPushChannel;
use App\Mail\VerifyAccount;
use App\Models\User;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Auth\Notifications\VerifyEmail;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Notification;
@@ -61,6 +62,16 @@ class AppServiceProvider extends ServiceProvider
->to($notifiable->getEmailForVerification())
);
ResetPassword::createUrlUsing(function (User $notifiable, string $token): string {
$passwordResetUrl = rtrim((string) config('services.mobile.password_reset_url'), '?&');
$query = http_build_query([
'email' => $notifiable->getEmailForPasswordReset(),
'token' => $token,
], '', '&', PHP_QUERY_RFC3986);
return "{$passwordResetUrl}?{$query}";
});
Gate::define('viewApiDocs', function ($user = null) {
// Option A : Autoriser tout le monde (Attention : la doc sera publique hors local)
return true;