Files
animethemes-server/app/Http/Middleware/Auth/Authenticate.php
T
paranarimasu 2e930b17ff feat: initial migration to Laravel 10 (#572)
* feat: initial migration to Laravel 10

* style: fix StyleCI findings
2023-04-18 16:22:36 -05:00

31 lines
682 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Middleware\Auth;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
/**
* Class Authenticate.
*/
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param Request $request
* @return string|null
*
* @noinspection PhpMissingParentCallCommonInspection
*/
protected function redirectTo(Request $request): ?string
{
return $request->expectsJson()
? null
: url(Config::get('wiki.login'));
}
}