Files
myprojplanet_vite/src/middleware/auth.ts

12 lines
312 B
TypeScript
Raw Normal View History

2021-08-31 18:09:59 +02:00
import { toolsext } from '@store/Modules/toolsext'
import { tools } from '@store/Modules/tools'
export default function auth({ next, router }: { next: any, router: any }) {
const tok = tools.getItemLS(toolsext.localStorage.token)
if (!tok) {
return router.push({ name: 'login' })
}
return next()
}