Skip to content

Commit

Permalink
i'm curious if it breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
wprzyb authored Feb 9, 2024
1 parent e9ffdf1 commit c28d06a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/app/LoginHeaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ export function getBarData(jwt: string) {
const relative = formatDistance(new Date(expirationTimestamp), Date.now(), {
addSuffix: true,
});

const expirationDate = format(new Date(expirationTimestamp), "MM/dd/yyyy");

return {
groups,
nickname: preferred_username,
expiration: relative,
expirationDate: expirationDate,
};
}
}
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export default function Home() {

const { groups, nickname, expiration } = getBarData(jwt);

return <Whoami groups={groups} nickname={nickname} expiration={expiration} />;
return <Whoami groups={groups} nickname={nickname} expiration={expiration} expirationDate={expirationDate} />;
}
2 changes: 1 addition & 1 deletion src/components/whoami.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function Whoami({ nickname, expiration, groups }: WhoamiProps) {
<div className="text-gray-700 dark:text-gray-300">
Access Token Expiry:{" "}
<span className="font-medium text-gray-900 dark:text-white">
{expiration}
{expiration} ({expirationDate})
</span>
</div>
</div>
Expand Down

0 comments on commit c28d06a

Please sign in to comment.