Move our /api routes into /ajax under web.php. The /api routes werent authenticated and may not have been using the logged in users details

This commit is contained in:
2025-04-26 15:48:27 +10:00
parent 0083e9158b
commit 21a690c6dd
8 changed files with 21 additions and 41 deletions

View File

@@ -17,7 +17,9 @@ class AllowAnonymous
*/
public function handle(Request $request,Closure $next): mixed
{
if (((! Cookie::has('username_encrypt')) || (! Cookie::has('password_encrypt'))) && (! config('pla.allow_guest',FALSE)))
if ((! config('pla.allow_guest',FALSE))
&& ($request->path() !== 'login')
&& ((! Cookie::has('username_encrypt')) || (! Cookie::has('password_encrypt'))))
return redirect()
->to('/login');