refresh token

This commit is contained in:
hamid zarghami
2025-04-17 17:31:38 +03:30
parent d3031e5557
commit 5666e05dd8
16 changed files with 685 additions and 301 deletions
+3 -1
View File
@@ -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
}