Files
animethemes-server/app/Http/Middleware/Auth/Authenticate.php
T
paranarimasu 6d66a3b6d1 feat(auth): remove jetstream auth scaffolding in favor of fortify SPA (#468)
* feat(auth): remove jetstream auth scaffolding in favor of fortify SPA

* fix: don't attempt to install non-existent npm dependencies in test runner
2022-09-26 15:03:01 -05:00

33 lines
694 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): ?string
{
if (! $request->expectsJson()) {
return url(Config::get('wiki.login'));
}
return null;
}
}