input('nonce')) { return $nonce; } // Otherwise, extract the nonce associated with the authorization code $encryptedAuthCode = request()->input('code'); if (! $encryptedAuthCode) { return null; } try { $key = Passport::tokenEncryptionKey(app('encrypter')); $decrypted = Crypto::decryptWithPassword($encryptedAuthCode, $key); $payload = json_decode($decrypted, true); if (isset($payload['auth_code_id'])) { $cacheKey = 'oidc_nonce_'.$payload['auth_code_id']; $nonce = Cache::get($cacheKey); Cache::forget($cacheKey); return $nonce; } } catch (Throwable $e) { Log::error($e->getMessage()); } return null; } }