fix login redirect
This commit is contained in:
@@ -15,8 +15,13 @@ include(__DIR__ . '/../../../extra/auth.php');
|
|||||||
// the user to vanguard login page.
|
// the user to vanguard login page.
|
||||||
|
|
||||||
if (! Auth::check()) {
|
if (! Auth::check()) {
|
||||||
|
// Cut everything at /userarea/ and append /login.
|
||||||
redirectTo('../../public/login');
|
$scriptName = $_SERVER['SCRIPT_NAME'] ?? '';
|
||||||
|
$basePath = substr($scriptName, 0, strpos($scriptName, '/userarea/'));
|
||||||
|
if ($basePath === false || $basePath === '') {
|
||||||
|
$basePath = '';
|
||||||
|
}
|
||||||
|
redirectTo($basePath . '/login');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
|
|||||||
Reference in New Issue
Block a user