jwt 로그인 구현 진행 : axios 로 api 호출하여 생성된 쿠키로 인증상태값 변경기능 구현

This commit is contained in:
2025-12-31 19:39:42 +09:00
parent fd40ce5e75
commit 985ba75d34
12 changed files with 340 additions and 35 deletions

View File

@@ -28,6 +28,7 @@ import {
import { AppBreadcrumb } from './index'
import { AppHeaderDropdown } from './header/index'
import { useAuth } from 'src/hooks/useAuth'
const AppHeader = () => {
const headerRef = useRef<HTMLDivElement>(null)
@@ -35,6 +36,8 @@ const AppHeader = () => {
const dispatch = useDispatch()
const sidebarShow = useSelector((state: RootState) => state.sidebarShow)
const { state } = useAuth()
const { isAuthenticated, member } = state
useEffect(() => {
const handleScroll = () => {
@@ -61,6 +64,11 @@ const AppHeader = () => {
<CHeaderNav className="ms-auto">
<CNavItem>
<CNavLink href="#">
{isAuthenticated && member && (
<span className="me-2 text-body-secondary fw-semibold">
{member.memberId}
</span>
)}
<CIcon icon={cilBell} size="lg" />
</CNavLink>
</CNavItem>