Skip to content

Commit

Permalink
Address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joerger committed Dec 4, 2024
1 parent e2645b1 commit 916e0fe
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion web/packages/shared/utils/createMfaOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Auth2faType, PreferredMfaType } from 'shared/services/types';

// Deprecated: use getMfaRegisterOptions or getMfaChallengeOptions instead.
// TODO(Joerger): Delete once no longer used.
export default function createMfaOptions(opts: Options): MfaOption[] {
export default function createMfaOptions(opts: Options) {
const { auth2faType, required = false } = opts;
const mfaOptions: MfaOption[] = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ 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,7 +90,9 @@ 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
15 changes: 9 additions & 6 deletions web/packages/teleport/src/services/mfa/mfaOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export function getMfaChallengeOptions(mfaChallenge: MfaAuthenticateChallenge) {
const mfaOptions: MfaOption[] = [];

if (mfaChallenge?.webauthnPublicKey) {
mfaOptions.push(webauthnOption);
mfaOptions.push(MFA_OPTION_WEBAUTHN);
}

if (mfaChallenge?.totpChallenge) {
mfaOptions.push(totpOption);
mfaOptions.push(MFA_OPTION_TOTP);
}

if (mfaChallenge?.ssoChallenge) {
Expand All @@ -24,11 +24,11 @@ export function getMfaRegisterOptions(auth2faType: Auth2faType) {
const mfaOptions: MfaOption[] = [];

if (auth2faType === 'webauthn' || auth2faType === 'on') {
mfaOptions.push(webauthnOption);
mfaOptions.push(MFA_OPTION_WEBAUTHN);
}

if (auth2faType === 'otp' || auth2faType === 'on') {
mfaOptions.push(totpOption);
mfaOptions.push(MFA_OPTION_TOTP);
}

return mfaOptions;
Expand All @@ -39,12 +39,15 @@ export type MfaOption = {
label: string;
};

const webauthnOption: MfaOption = {
const MFA_OPTION_WEBAUTHN: MfaOption = {
value: 'webauthn',
label: 'Passkey or Security Key',
};

const totpOption: MfaOption = { value: 'totp', label: 'Authenticator App' };
const MFA_OPTION_TOTP: MfaOption = {
value: 'totp',
label: 'Authenticator App',
};

const getSsoOption = (ssoChallenge: SSOChallenge): MfaOption => {
return {
Expand Down

0 comments on commit 916e0fe

Please sign in to comment.