simple jwt token validation from frontend

This commit is contained in:
IluaAir
2025-10-15 23:03:24 +03:00
parent 7768f94122
commit 2722488a4e
2 changed files with 16 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ import './dashboard.css';
import { MenuDock } from '@/components/ui/shadcn-io/menu-dock';
import { Home, Settings, Bell } from 'lucide-react';
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar';
import { jwtexp } from '@/lib/utils';
const menuItems = [
{ label: 'home', icon: Home, onClick: () => console.log('Home clicked') },
{ label: 'notify', icon: Bell, onClick: () => console.log('Notifications clicked') },
@@ -21,7 +21,9 @@ export default function Dashboard() {
{ title: "title16", due_date: "2025-10-15", priority: "medium", id: 6, status: "completed" },
{ title: "super late title", due_date: "2025-10-15", priority: "low", id: 2, status: "open" }
];
const token = localStorage.getItem('access_token');
const tokenExp = jwtexp(token);
console.log(tokenExp);
// Get current date and week
const today = new Date();
const currentDay = today.getDay();