Update launcher session handling
This commit is contained in:
1 parent
21486b606b
commit
f8da17b9db
2 files changed
+133
-16
No files matched your search
@@ -52,7 +52,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
|
||||
if ($action === 'logout') {
|
||||
custom_clear_auth_cookie();
|
||||
$scope = (string)($data['scope'] ?? '');
|
||||
if ($scope === 'admin') {
|
||||
custom_clear_auth_cookie();
|
||||
} elseif (function_exists('custom_clear_non_admin_auth_cookie')) {
|
||||
custom_clear_non_admin_auth_cookie(false);
|
||||
} else {
|
||||
custom_clear_auth_cookie();
|
||||
}
|
||||
custom_json(['result' => 'ok']);
|
||||
}
|
||||
|
||||
@@ -93,12 +100,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
if (isset($_GET['session'])) {
|
||||
$denied = custom_login_denied_state();
|
||||
if (!empty($denied['denied'])) {
|
||||
$blockedType = (string)($denied['type'] ?? '');
|
||||
if (!empty($denied['denied']) && !($blockedType !== 'ip' && custom_is_site_admin())) {
|
||||
if ($blockedType === 'ip') {
|
||||
custom_clear_auth_cookie();
|
||||
} elseif (function_exists('custom_clear_non_admin_auth_cookie')) {
|
||||
custom_clear_non_admin_auth_cookie(true);
|
||||
} else {
|
||||
custom_clear_auth_cookie();
|
||||
}
|
||||
custom_json([
|
||||
'authenticated' => false,
|
||||
'admin' => false,
|
||||
'loginBlocked' => true,
|
||||
'blockedType' => $denied['type'] ?? '',
|
||||
'blockedType' => $blockedType,
|
||||
'blockedMessage' => $denied['message'] ?? '현재 로그인할 수 없는 상태입니다.',
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user