Fix Signed url to be relative a cause de serveurs de merde
This commit is contained in:
parent
2b1a47f48c
commit
f90e808cd0
4 changed files with 67 additions and 2 deletions
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue