Skip to content

Commit

Permalink
Fix lint; Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joerger committed Dec 3, 2024
1 parent b1ae9e0 commit 9755a70
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,8 @@ export function CreateEc2IceDialog({
style={{ display: 'flex', textAlign: 'left', width: '100%' }}
>
<Icons.Check size="small" ml={1} mr={2} color="success.main" />
The EC2 instance [{
typedAgentMeta?.node.awsMetadata.instanceId
}] has been added to Teleport.
The EC2 instance [{typedAgentMeta?.node.awsMetadata.instanceId}] has
been added to Teleport.
</Text>
<ButtonPrimary width="100%" onClick={() => nextStep()}>
Next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ export function CreatedDiscoveryConfigDialog({
<>
{' '}
The discovery service can take a few minutes to finish
auto-enrolling resources found in region <Mark>
{region}
</Mark>.
auto-enrolling resources found in region <Mark>{region}</Mark>.
</>
)}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import React from 'react';
import { render, screen, fireEvent } from 'design/utils/testing';

import { makeDefaultMfaState, MfaState } from 'teleport/lib/useMfa';
import { SSOChallenge } from 'teleport/services/auth';

import { SSOChallenge } from 'teleport/services/mfa';

import AuthnDialog from './AuthnDialog';

Expand Down
8 changes: 4 additions & 4 deletions web/packages/teleport/src/services/mfa/mfaOptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('test retrieving mfa options from MFA Challenge', () => {
{
name: 'challenge webauthn',
challenge: {
webauthnPublicKey: Object.create(PublicKeyCredential),
webauthnPublicKey: {} as PublicKeyCredentialRequestOptions,
},
expect: ['webauthn'],
},
Expand All @@ -85,16 +85,16 @@ describe('test retrieving mfa options from MFA Challenge', () => {
challenge: {
ssoChallenge: Object.create(SSOChallenge),
},
expect: ['webauthn', 'totp'],
expect: ['sso'],
},
{
name: 'challenge all',
challenge: {
totpChallenge: true,
webauthnPublicKey: Object.create(PublicKeyCredential),
webauthnPublicKey: {} as PublicKeyCredentialRequestOptions,
ssoChallenge: Object.create(SSOChallenge),
},
expect: ['webauthn', 'totp'],
expect: ['webauthn', 'totp', 'sso'],
},
];

Expand Down
5 changes: 4 additions & 1 deletion web/packages/teleport/src/services/mfa/mfaOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const totpOption: MfaOption = { value: 'totp', label: 'Authenticator App' };
const getSsoOption = (ssoChallenge: SSOChallenge): MfaOption => {
return {
value: 'sso',
label: ssoChallenge.device.displayName || ssoChallenge.device.connectorId,
label:
ssoChallenge.device?.displayName ||
ssoChallenge.device?.connectorId ||
'SSO',
};
};

0 comments on commit 9755a70

Please sign in to comment.