����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.145.38.251 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/bofirm.gltechlimited.com/vendor/laravel/passport/src/ |
Upload File : |
<?php namespace Laravel\Passport; use Carbon\Carbon; use Firebase\JWT\JWT; use Illuminate\Contracts\Config\Repository as Config; use Illuminate\Contracts\Encryption\Encrypter; use Symfony\Component\HttpFoundation\Cookie; class ApiTokenCookieFactory { /** * The configuration repository implementation. * * @var \Illuminate\Contracts\Config\Repository */ protected $config; /** * The encrypter implementation. * * @var \Illuminate\Contracts\Encryption\Encrypter */ protected $encrypter; /** * Create an API token cookie factory instance. * * @param \Illuminate\Contracts\Config\Repository $config * @param \Illuminate\Contracts\Encryption\Encrypter $encrypter * @return void */ public function __construct(Config $config, Encrypter $encrypter) { $this->config = $config; $this->encrypter = $encrypter; } /** * Create a new API token cookie. * * @param mixed $userId * @param string $csrfToken * @return \Symfony\Component\HttpFoundation\Cookie */ public function make($userId, $csrfToken) { $config = $this->config->get('session'); $expiration = Carbon::now()->addMinutes($config['lifetime']); return new Cookie( Passport::cookie(), $this->createToken($userId, $csrfToken, $expiration), $expiration, $config['path'], $config['domain'], $config['secure'], true, false, $config['same_site'] ?? null ); } /** * Create a new JWT token for the given user ID and CSRF token. * * @param mixed $userId * @param string $csrfToken * @param \Carbon\Carbon $expiration * @return string */ protected function createToken($userId, $csrfToken, Carbon $expiration) { return JWT::encode([ 'sub' => $userId, 'csrf' => $csrfToken, 'expiry' => $expiration->getTimestamp(), ], Passport::tokenEncryptionKey($this->encrypter), 'HS256'); } }