UNPKG

@inertiapixel/nextjs-auth

Version:

Authentication system for Next.js. Supports credentials and social login, JWT token management, and lifecycle hooks — designed to integrate with nodejs-auth for full-stack MERN apps.

13 lines (12 loc) 309 B
// src/utils/tokenUtils.ts import { jwtDecode } from 'jwt-decode'; export const parseToken = (token) => { const decoded = jwtDecode(token); return { id: decoded.id, email: decoded.email, name: decoded.name, role: decoded.role, avatar: decoded.avatar, }; };