mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-09 12:58:22 +02:00
frontend: react+mui (#3004)
* mui v5 wip * wip * wip * wip * use compressor for all controlplane endpoints * wip * wip * add deps * fix authenticate URL * fix test * fix test * fix build * maybe fix build * fix integration test * remove image asset test * add yarn.lock
This commit is contained in:
parent
64d8748251
commit
2824faecbf
84 changed files with 13373 additions and 1455 deletions
24
ui/src/components/ClaimValue.tsx
Normal file
24
ui/src/components/ClaimValue.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import IDField from "./IDField";
|
||||
import { DateTime } from "luxon";
|
||||
import React, { FC } from "react";
|
||||
|
||||
const unixSecondTimestampFields = new Set(["exp", "iat", "nbf", "auth_time"]);
|
||||
|
||||
const idFields = new Set(["groups", "jti", "oid", "tid", "wids"]);
|
||||
|
||||
type ClaimValueProps = {
|
||||
claimKey: string;
|
||||
claimValue: unknown;
|
||||
};
|
||||
const ClaimValue: FC<ClaimValueProps> = ({ claimKey, claimValue }) => {
|
||||
if (unixSecondTimestampFields.has(claimKey)) {
|
||||
return <>{DateTime.fromMillis((claimValue as number) * 1000).toISO()}</>;
|
||||
}
|
||||
|
||||
if (idFields.has(claimKey)) {
|
||||
return <IDField value={`${claimValue}`} />;
|
||||
}
|
||||
|
||||
return <>{`${claimValue}`}</>;
|
||||
};
|
||||
export default ClaimValue;
|
Loading…
Add table
Add a link
Reference in a new issue