refresh token
This commit is contained in:
@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'
|
||||
import { clx } from '../helpers/utils'
|
||||
import { Pages } from '../config/Pages'
|
||||
import { useSharedStore } from './store/sharedStore'
|
||||
import { removeToken, removeRefreshToken } from '../config/func'
|
||||
|
||||
type Props = {
|
||||
icon: ReactNode,
|
||||
@@ -17,7 +18,8 @@ const SideBarItem: FC<Props> = (props: Props) => {
|
||||
|
||||
const { hasSubMenu, setSubMenuName, setSubtMenu } = useSharedStore()
|
||||
const handleLogout = () => {
|
||||
localStorage.removeItem(import.meta.env.VITE_TOKEN_NAME)
|
||||
removeToken()
|
||||
removeRefreshToken()
|
||||
window.location.href = Pages.auth.login
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user