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. 1
      src/lib/utils.ts

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

@ -4,6 +4,7 @@ export const TOKEN_COOKIE_NAME = '__timefyi_jt__';
export type TokenPayload = { export type TokenPayload = {
id: string; id: string;
email: string; email: string;
name: string;
}; };
export function decodeToken(token: string): TokenPayload { export function decodeToken(token: string): TokenPayload {

Loading…
Cancel
Save