jwt 로그인 구현 진행 : axios 로 api 호출하여 생성된 쿠키로 인증상태값 변경기능 구현
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user