Skip to content

Commit

Permalink
[v16] Add userTrustedDeviceComponent to Account props (#49660)
Browse files Browse the repository at this point in the history
Backport #49338
  • Loading branch information
avatus authored Dec 3, 2024
1 parent f50a96e commit 2ea2b44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions web/packages/teleport/src/Account/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ export interface EnterpriseComponentProps {

export interface AccountPageProps {
enterpriseComponent?: React.ComponentType<EnterpriseComponentProps>;
userTrustedDevicesComponent?: React.ComponentType;
}

export function AccountPage({ enterpriseComponent }: AccountPageProps) {
export function AccountPage({
enterpriseComponent,
userTrustedDevicesComponent,
}: AccountPageProps) {
const ctx = useTeleport();
const storeUser = useStore(ctx.storeUser);
const isSso = storeUser.isSso();
Expand All @@ -84,6 +88,7 @@ export function AccountPage({ enterpriseComponent }: AccountPageProps) {
passwordState={storeUser.getPasswordState()}
{...manageDevicesState}
enterpriseComponent={enterpriseComponent}
userTrustedDevicesComponent={userTrustedDevicesComponent}
onPasswordChange={onPasswordChange}
/>
);
Expand Down Expand Up @@ -115,6 +120,7 @@ export function Account({
canAddPasskeys,
enterpriseComponent: EnterpriseComponent,
newDeviceUsage,
userTrustedDevicesComponent: TrustedDeviceListComponent,
passwordState,
onPasswordChange: onPasswordChangeCb,
}: AccountProps) {
Expand Down Expand Up @@ -193,7 +199,7 @@ export function Account({

return (
<Relative>
<FeatureBox>
<FeatureBox maxWidth={1440} m="auto">
<FeatureHeader>
<FeatureHeaderTitle>Account Settings</FeatureHeaderTitle>
</FeatureHeader>
Expand Down Expand Up @@ -266,6 +272,7 @@ export function Account({
{EnterpriseComponent && (
<EnterpriseComponent addNotification={addNotification} />
)}
{TrustedDeviceListComponent && <TrustedDeviceListComponent />}
</Flex>
</FeatureBox>

Expand Down
3 changes: 2 additions & 1 deletion web/packages/teleport/src/DeviceTrust/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export type TrustedDevice = {
assetTag: string;
osType: TrustedDeviceOSType;
enrollStatus: 'enrolled' | 'not enrolled';
owner?: string;
owner: string;
createTime?: Date;
};

export type TrustedDeviceOSType = 'Windows' | 'Linux' | 'macOS';
Expand Down

0 comments on commit 2ea2b44

Please sign in to comment.