worker service 매물 등록 및 redis 다운시 처리

This commit is contained in:
2026-03-25 20:51:38 +09:00
parent a170fdc774
commit 0b6ed3df73
12 changed files with 976 additions and 199 deletions

View File

@@ -13,10 +13,31 @@ class AuthCheck implements FilterInterface
$session = session();
log_message('debug', 'URI PATH: ' . service('uri')->getPath());
// 로그인 체크
if (!$session->get('logged_in')) {
// 로그인 안 되어 있으면 로그인 페이지로
return redirect()->to('/login');
try {
// 세션 읽기 시도
$loggedIn = $session->get('logged_in');
// 로그인 체크
if (!$loggedIn) {
// 로그인 안 되어 있으면 로그인 페이지로
return redirect()->to('/login');
}
} catch (\Exception $e) {
// 세션 오류 (Redis 다운 등) - 모든 예외 catch
log_message('error', '[SESSION ERROR in AuthCheck] ' . $e->getMessage());
// AJAX 요청인 경우 JSON 응답
if ($request->isAJAX()) {
return service('response')
->setStatusCode(503)
->setJSON([
'code' => '8',
'msg' => '세션 서비스 오류입니다. 페이지를 새로고침 해주세요. (Redis)'
]);
}
// 일반 요청인 경우 로그인 페이지로 리다이렉트 (에러 메시지 포함)
return redirect()->to('/login')->with('error', '세션 서비스 오류입니다. 시스템 관리자에게 문의해주세요.');
}
}