chore: added name in token decode return

feat/preact-migrate
Arik Chakma 2 years ago
parent f354130f35
commit 5cdc443261
  1. 2
      src/components/Login/account-nav.tsx
  2. 3
      src/lib/utils.ts

@ -21,7 +21,7 @@ export default function AccountNavigation() {
return (
<div>
{isAuthenticated ? (
<div>Authenticated: {user?.email}</div>
<div>Authenticated: {user?.name}</div>
) : (
<div>Not Authenticated</div>
)}

@ -4,10 +4,11 @@ export const TOKEN_COOKIE_NAME = '__timefyi_jt__';
export type TokenPayload = {
id: string;
email: string;
name: string;
};
export function decodeToken(token: string): TokenPayload {
const claims = jose.decodeJwt(token);
return claims as TokenPayload;
}
}

Loading…
Cancel
Save