Fix maintenance constraint page.

This commit is contained in:
Graphictoria 2022-04-23 16:16:01 -04:00
parent 23f75ea803
commit a65e618d04
4 changed files with 6 additions and 4 deletions

View File

@ -45,7 +45,7 @@ class MaintenanceController extends Controller
if(isset($data['secret']) && $btns === $mtconf->combination)
{
$trustedHosts = explode(',', env('TRUSTED_HOSTS'));
$origin = join('.', array_slice(explode('.', $request->headers->get('origin')), -2));
$origin = join('.', array_slice(explode('.', explode('//', $request->headers->get('origin'))[1]), -2));
$passCheck = false;
foreach($trustedHosts as &$host)
@ -60,8 +60,7 @@ class MaintenanceController extends Controller
'expires_at' => $expiresAt->getTimestamp(),
'mac' => hash_hmac('SHA256', $expiresAt->getTimestamp(), $data['secret']),
])), $expiresAt);
$bypassCookie = $bypassCookie->withSecure(false);
//$bypassCookie = $bypassCookie->withSameSite('none');
$bypassCookie = $bypassCookie->withSameSite('none');
if($passCheck)
$bypassCookie = $bypassCookie->withDomain('.' . $origin);

View File

@ -45,6 +45,7 @@ class Kernel extends HttpKernel
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\App\Http\Middleware\EncryptCookies::class,
],
];

View File

@ -1,5 +1,5 @@
{
"/js/app.js": "/js/app.js?id=cd2fb1cee326ab151ccc",
"/js/pages/maintenance.js": "/js/pages/maintenance.js?id=48c6a431110c9ea51807",
"/js/pages/maintenance.js": "/js/pages/maintenance.js?id=bdec3edf7c97c2fbbd28",
"/css/graphictoria.css": "/css/graphictoria.css?id=569f8477631683f9ea96"
}

View File

@ -13,6 +13,8 @@ import { buildGenericApiUrl } from '../util/HTTP.js';
import { Canvas, useFrame } from '@react-three/fiber';
import { Instances, Instance, PerspectiveCamera, useGLTF } from '@react-three/drei';
axios.defaults.withCredentials = true;
const randomVector = (r) => [r / 2 - Math.random() * r, r / 2 - Math.random() * r, r / 2 - Math.random() * r];
const randomEuler = () => [Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI];
const randomData = Array.from({ length: 2000 }, (r = 200) => ({ random: Math.random(), position: randomVector(r), rotation: randomEuler() }));