diff --git a/app/Http/Controllers/Fo/Auth/VerificationController.php b/app/Http/Controllers/Fo/Auth/VerificationController.php index 5de0e0e..76ac6fe 100644 --- a/app/Http/Controllers/Fo/Auth/VerificationController.php +++ b/app/Http/Controllers/Fo/Auth/VerificationController.php @@ -18,7 +18,7 @@ class VerificationController extends Controller public function __construct() { $this->middleware('auth:frontend'); - $this->middleware('signed')->only('verify'); + $this->middleware('signed:relative')->only('verify'); $this->middleware('throttle:6,1')->only('verify', 'resend'); } diff --git a/app/Lib/Payments/PaymentAdapter.php b/app/Lib/Payments/PaymentAdapter.php index 338f10d..6961116 100644 --- a/app/Lib/Payments/PaymentAdapter.php +++ b/app/Lib/Payments/PaymentAdapter.php @@ -56,7 +56,12 @@ abstract class PaymentAdapter protected function successRoute(Transaction $transaction, array $parameters = []): string { $parameters['transaction'] = $transaction; - return URL::signedRoute('order-tunnel.checkout', $parameters, \now()->addMinutes(3)); + return \url(URL::temporarySignedRoute( + 'verification.verify', + \now()->addMinutes(3), + $parameters, + false + )); } /** diff --git a/app/Notifications/Customer/ResetPassword.php b/app/Notifications/Customer/ResetPassword.php index c720902..e7aa7f6 100644 --- a/app/Notifications/Customer/ResetPassword.php +++ b/app/Notifications/Customer/ResetPassword.php @@ -4,9 +4,39 @@ namespace App\Notifications\Customer; use Illuminate\Auth\Notifications\ResetPassword as NotificationsResetPassword; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Support\Facades\URL; class ResetPassword extends NotificationsResetPassword { + /** + * The callback that should be used to create the reset password URL. + * + * @var \Closure|null + */ + public static $createUrlCallback; + + /** + * ResetPassword + * + * @param string $token + * @return void + */ + public function __construct(string $token) + { + parent::__construct($token); + static::$createUrlCallback = function ($notifiable, $token) { + return \url(URL::temporarySignedRoute( + 'password.reset', + now()->addHours(24), + [ + 'token' => $token, + 'email' => $notifiable->getEmailForPasswordReset(), + ], + false + )); + }; + } + /** * Build the mail representation of the notification. * diff --git a/app/Notifications/Customer/VerifyEmail.php b/app/Notifications/Customer/VerifyEmail.php index aa3cb3e..4fe521c 100644 --- a/app/Notifications/Customer/VerifyEmail.php +++ b/app/Notifications/Customer/VerifyEmail.php @@ -4,9 +4,39 @@ namespace App\Notifications\Customer; use Illuminate\Auth\Notifications\VerifyEmail as NotificationsVerifyEmail; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Config; +use Illuminate\Support\Facades\URL; class VerifyEmail extends NotificationsVerifyEmail { + /** + * The callback that should be used to create the reset password URL. + * + * @var \Closure|null + */ + public static $createUrlCallback; + + /** + * VerifyEmail + * + * @return void + */ + public function __construct() + { + static::$createUrlCallback = function ($notifiable) { + return \url(URL::temporarySignedRoute( + 'verification.verify', + Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)), + [ + 'id' => $notifiable->getKey(), + 'hash' => sha1($notifiable->getEmailForVerification()), + ], + false + )); + }; + } + /** * Build the mail representation of the notification. *