From 91c848be17c9f68f721a14ac9a670e930b26e331 Mon Sep 17 00:00:00 2001 From: joerger Date: Mon, 9 Dec 2024 14:25:44 -0800 Subject: [PATCH] Fix lint. --- .../teleport/src/Account/Account.test.tsx | 5 +- .../ChangePasswordWizard.test.tsx | 25 ++-- .../ChangePasswordWizard.tsx | 3 +- .../wizards/AddAuthDeviceWizard.story.tsx | 10 +- .../wizards/AddAuthDeviceWizard.test.tsx | 113 ++++++++---------- .../wizards/DeleteAuthDeviceWizard.story.tsx | 6 +- .../wizards/DeleteAuthDeviceWizard.test.tsx | 41 +++---- .../wizards/DeleteAuthDeviceWizard.tsx | 3 +- .../wizards/ReauthenticateStep.tsx | 2 +- .../ReAuthenticate/ReAuthenticate.story.tsx | 3 +- .../teleport/src/services/auth/auth.ts | 2 - 11 files changed, 93 insertions(+), 120 deletions(-) diff --git a/web/packages/teleport/src/Account/Account.test.tsx b/web/packages/teleport/src/Account/Account.test.tsx index 2ef6cdc931e25..af4340e48a90b 100644 --- a/web/packages/teleport/src/Account/Account.test.tsx +++ b/web/packages/teleport/src/Account/Account.test.tsx @@ -29,10 +29,7 @@ import cfg from 'teleport/config'; import { createTeleportContext } from 'teleport/mocks/contexts'; import { PasswordState } from 'teleport/services/user'; import auth from 'teleport/services/auth/auth'; -import MfaService, { - MfaDevice, - WebauthnAssertionResponse, -} from 'teleport/services/mfa'; +import MfaService, { MfaDevice } from 'teleport/services/mfa'; const defaultAuthType = cfg.auth.second_factor; const defaultPasswordless = cfg.auth.allowPasswordless; diff --git a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.test.tsx b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.test.tsx index 6ff139610cc8d..eeeb4da32cf88 100644 --- a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.test.tsx +++ b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.test.tsx @@ -25,7 +25,6 @@ import { userEvent, UserEvent } from '@testing-library/user-event'; import auth, { MfaChallengeScope } from 'teleport/services/auth/auth'; import { - MFA_OPTION_SSO_DEFAULT, MFA_OPTION_TOTP, MFA_OPTION_WEBAUTHN, MfaChallengeResponse, @@ -90,15 +89,15 @@ describe('with passwordless reauthentication', () => { async function reauthenticate() { render(); - const reauthenticateStep = await waitFor(() => { - return within(screen.getByTestId('reauthenticate-step')); + await waitFor(() => { + expect(screen.getByTestId('reauthenticate-step')).toBeInTheDocument(); }); expect(auth.getMfaChallenge).toHaveBeenCalledWith({ scope: MfaChallengeScope.CHANGE_PASSWORD, }); - await user.click(reauthenticateStep.getByText('Passkey')); - await user.click(reauthenticateStep.getByText('Next')); + await user.click(screen.getByText('Passkey')); + await user.click(screen.getByText('Next')); expect(auth.getMfaChallenge).toHaveBeenCalledWith({ scope: MfaChallengeScope.CHANGE_PASSWORD, userVerificationRequirement: 'required', @@ -188,15 +187,15 @@ describe('with WebAuthn MFA reauthentication', () => { async function reauthenticate() { render(); - const reauthenticateStep = await waitFor(() => { - return within(screen.getByTestId('reauthenticate-step')); + await waitFor(() => { + expect(screen.getByTestId('reauthenticate-step')).toBeInTheDocument(); }); expect(auth.getMfaChallenge).toHaveBeenCalledWith({ scope: MfaChallengeScope.CHANGE_PASSWORD, }); - await user.click(reauthenticateStep.getByText('Security Key')); - await user.click(reauthenticateStep.getByText('Next')); + await user.click(screen.getByText('Security Key')); + await user.click(screen.getByText('Next')); expect(auth.getMfaChallengeResponse).toHaveBeenCalled(); } @@ -293,11 +292,11 @@ describe('with OTP MFA reauthentication', () => { async function reauthenticate() { render(); - const reauthenticateStep = await waitFor(() => { - return within(screen.getByTestId('reauthenticate-step')); + await waitFor(() => { + expect(screen.getByTestId('reauthenticate-step')).toBeInTheDocument(); }); - await user.click(reauthenticateStep.getByText('Authenticator App')); - await user.click(reauthenticateStep.getByText('Next')); + await user.click(screen.getByText('Authenticator App')); + await user.click(screen.getByText('Next')); } it('changes password', async () => { diff --git a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.tsx b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.tsx index d2eb2cc4b45dc..56fda8f9cd90c 100644 --- a/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.tsx +++ b/web/packages/teleport/src/Account/ChangePasswordWizard/ChangePasswordWizard.tsx @@ -35,6 +35,8 @@ import { useAsync } from 'shared/hooks/useAsync'; import Box from 'design/Box'; +import Indicator from 'design/Indicator'; + import { ChangePasswordReq } from 'teleport/services/auth'; import auth, { MfaChallengeScope } from 'teleport/services/auth/auth'; import { @@ -43,7 +45,6 @@ import { WebauthnAssertionResponse, } from 'teleport/services/mfa'; import useReAuthenticate from 'teleport/components/ReAuthenticate/useReAuthenticate'; -import Indicator from 'design/Indicator'; export interface ChangePasswordWizardProps { hasPasswordless: boolean; diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.story.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.story.tsx index edd6e72596009..c1b1acd279a12 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.story.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.story.tsx @@ -22,13 +22,14 @@ import Dialog from 'design/Dialog'; import { http, HttpResponse, delay } from 'msw'; +import { Attempt } from 'shared/hooks/useAttemptNext'; + import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContextProvider } from 'teleport/index'; import cfg from 'teleport/config'; import { - DeviceType, DeviceUsage, MFA_OPTION_SSO_DEFAULT, MFA_OPTION_TOTP, @@ -41,7 +42,6 @@ import { SaveDeviceStep, } from './AddAuthDeviceWizard'; import { ReauthenticateStep } from './ReauthenticateStep'; -import { Attempt } from 'shared/hooks/useAttemptNext'; export default { title: 'teleport/Account/Manage Devices/Add Device Wizard', @@ -177,12 +177,12 @@ const stepProps: AddAuthDeviceWizardStepProps = { MFA_OPTION_TOTP, MFA_OPTION_SSO_DEFAULT, ], - submitWithMfa: async (mfaType?: DeviceType, otpCode?: string) => {}, + submitWithMfa: async () => {}, // Create props mfaRegisterOptions: [MFA_OPTION_WEBAUTHN, MFA_OPTION_TOTP], - onDeviceCreated: (c: Credential) => {}, - onNewMfaDeviceTypeChange: (d: DeviceType) => {}, + onDeviceCreated: () => {}, + onNewMfaDeviceTypeChange: () => {}, // Save props credential: { id: 'cred-id', type: 'public-key' }, diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.test.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.test.tsx index 0a200980cee4a..f54bd8ee22e90 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.test.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/AddAuthDeviceWizard.test.tsx @@ -19,7 +19,7 @@ import { render, screen } from 'design/utils/testing'; import React from 'react'; -import { waitFor, within } from '@testing-library/react'; +import { waitFor } from '@testing-library/react'; import { userEvent, UserEvent } from '@testing-library/user-event'; import TeleportContext from 'teleport/teleportContext'; @@ -82,22 +82,18 @@ describe('flow without reauthentication', () => { ); - const createStep = await waitFor(() => { - return within(screen.getByTestId('create-step')); + await waitFor(() => { + expect(screen.getByTestId('create-step')).toBeInTheDocument(); }); - await user.click( - createStep.getByRole('button', { name: 'Create a passkey' }) - ); + await user.click(screen.getByRole('button', { name: 'Create a passkey' })); expect(auth.createNewWebAuthnDevice).toHaveBeenCalledWith({ tokenId: 'privilege-token', deviceUsage: 'passwordless', }); - const saveStep = within(screen.getByTestId('save-step')); - await user.type(saveStep.getByLabelText('Passkey Nickname'), 'new-passkey'); - await user.click( - saveStep.getByRole('button', { name: 'Save the Passkey' }) - ); + expect(screen.getByTestId('save-step')).toBeInTheDocument(); + await user.type(screen.getByLabelText('Passkey Nickname'), 'new-passkey'); + await user.click(screen.getByRole('button', { name: 'Save the Passkey' })); expect(ctx.mfaService.saveNewWebAuthnDevice).toHaveBeenCalledWith({ credential: dummyCredential, addRequest: { @@ -112,22 +108,22 @@ describe('flow without reauthentication', () => { test('adds a WebAuthn MFA', async () => { render(); - const createStep = await waitFor(() => { - return within(screen.getByTestId('create-step')); + await waitFor(() => { + expect(screen.getByTestId('create-step')).toBeInTheDocument(); }); - await user.click(createStep.getByLabelText('Security Key')); + await user.click(screen.getByLabelText('Security Key')); await user.click( - createStep.getByRole('button', { name: 'Create an MFA method' }) + screen.getByRole('button', { name: 'Create an MFA method' }) ); expect(auth.createNewWebAuthnDevice).toHaveBeenCalledWith({ tokenId: 'privilege-token', deviceUsage: 'mfa', }); - const saveStep = within(screen.getByTestId('save-step')); - await user.type(saveStep.getByLabelText('MFA Method Name'), 'new-mfa'); + expect(screen.getByTestId('save-step')).toBeInTheDocument(); + await user.type(screen.getByLabelText('MFA Method Name'), 'new-mfa'); await user.click( - saveStep.getByRole('button', { name: 'Save the MFA method' }) + screen.getByRole('button', { name: 'Save the MFA method' }) ); expect(ctx.mfaService.saveNewWebAuthnDevice).toHaveBeenCalledWith({ credential: dummyCredential, @@ -143,24 +139,24 @@ describe('flow without reauthentication', () => { test('adds an authenticator app', async () => { render(); - const createStep = await waitFor(() => { - return within(screen.getByTestId('create-step')); + await waitFor(() => { + expect(screen.getByTestId('create-step')).toBeInTheDocument(); }); - await user.click(createStep.getByLabelText('Authenticator App')); - expect(createStep.getByRole('img')).toHaveAttribute( + await user.click(screen.getByLabelText('Authenticator App')); + expect(screen.getByRole('img')).toHaveAttribute( 'src', 'data:image/png;base64,dummy-qr-code' ); await user.click( - createStep.getByRole('button', { name: 'Create an MFA method' }) + screen.getByRole('button', { name: 'Create an MFA method' }) ); - const saveStep = within(screen.getByTestId('save-step')); - await user.type(saveStep.getByLabelText('MFA Method Name'), 'new-mfa'); - await user.type(saveStep.getByLabelText(/Authenticator Code/), '345678'); + expect(screen.getByTestId('save-step')).toBeInTheDocument(); + await user.type(screen.getByLabelText('MFA Method Name'), 'new-mfa'); + await user.type(screen.getByLabelText(/Authenticator Code/), '345678'); await user.click( - saveStep.getByRole('button', { name: 'Save the MFA method' }) + screen.getByRole('button', { name: 'Save the MFA method' }) ); expect(ctx.mfaService.addNewTotpDevice).toHaveBeenCalledWith({ tokenId: 'privilege-token', @@ -186,28 +182,24 @@ describe('flow with reauthentication', () => { test('adds a passkey with WebAuthn reauthentication', async () => { render(); - const reauthenticateStep = await waitFor(() => { - return within(screen.getByTestId('reauthenticate-step')); + await waitFor(() => { + expect(screen.getByTestId('reauthenticate-step')).toBeInTheDocument(); }); - await user.click(reauthenticateStep.getByText('Verify my identity')); + await user.click(screen.getByText('Verify my identity')); - const createStep = await waitFor(() => { - return within(screen.getByTestId('create-step')); + await waitFor(() => { + expect(screen.getByTestId('create-step')).toBeInTheDocument(); }); - await user.click( - createStep.getByRole('button', { name: 'Create a passkey' }) - ); + await user.click(screen.getByRole('button', { name: 'Create a passkey' })); expect(auth.createNewWebAuthnDevice).toHaveBeenCalledWith({ tokenId: 'privilege-token', deviceUsage: 'passwordless', }); - const saveStep = within(screen.getByTestId('save-step')); - await user.type(saveStep.getByLabelText('Passkey Nickname'), 'new-passkey'); - await user.click( - saveStep.getByRole('button', { name: 'Save the Passkey' }) - ); + expect(screen.getByTestId('save-step')).toBeInTheDocument(); + await user.type(screen.getByLabelText('Passkey Nickname'), 'new-passkey'); + await user.click(screen.getByRole('button', { name: 'Save the Passkey' })); expect(ctx.mfaService.saveNewWebAuthnDevice).toHaveBeenCalledWith({ credential: dummyCredential, addRequest: { @@ -222,33 +214,26 @@ describe('flow with reauthentication', () => { test('adds a passkey with OTP reauthentication', async () => { render(); - const reauthenticateStep = await waitFor(() => { - return within(screen.getByTestId('reauthenticate-step')); + await waitFor(() => { + expect(screen.getByTestId('reauthenticate-step')).toBeInTheDocument(); }); - await user.click(reauthenticateStep.getByText('Authenticator App')); - await user.type( - reauthenticateStep.getByLabelText('Authenticator Code'), - '654987' - ); - await user.click(reauthenticateStep.getByText('Verify my identity')); + await user.click(screen.getByText('Authenticator App')); + await user.type(screen.getByLabelText('Authenticator Code'), '654987'); + await user.click(screen.getByText('Verify my identity')); - const createStep = await waitFor(() => { - return within(screen.getByTestId('create-step')); + await waitFor(() => { + expect(screen.getByTestId('create-step')).toBeInTheDocument(); }); - await user.click( - createStep.getByRole('button', { name: 'Create a passkey' }) - ); + await user.click(screen.getByRole('button', { name: 'Create a passkey' })); expect(auth.createNewWebAuthnDevice).toHaveBeenCalledWith({ tokenId: 'privilege-token', deviceUsage: 'passwordless', }); - const saveStep = within(screen.getByTestId('save-step')); - await user.type(saveStep.getByLabelText('Passkey Nickname'), 'new-passkey'); - await user.click( - saveStep.getByRole('button', { name: 'Save the Passkey' }) - ); + expect(screen.getByTestId('save-step')).toBeInTheDocument(); + await user.type(screen.getByLabelText('Passkey Nickname'), 'new-passkey'); + await user.click(screen.getByRole('button', { name: 'Save the Passkey' })); expect(ctx.mfaService.saveNewWebAuthnDevice).toHaveBeenCalledWith({ credential: dummyCredential, addRequest: { @@ -263,15 +248,11 @@ describe('flow with reauthentication', () => { test('shows reauthentication options', async () => { render(); - const reauthenticateStep = await waitFor(() => { - return within(screen.getByTestId('reauthenticate-step')); + await waitFor(() => { + expect(screen.getByTestId('reauthenticate-step')).toBeInTheDocument(); }); - expect( - reauthenticateStep.queryByLabelText(/passkey or security key/i) - ).toBeVisible(); - expect( - reauthenticateStep.queryByLabelText(/authenticator app/i) - ).toBeVisible(); + expect(screen.queryByLabelText(/passkey or security key/i)).toBeVisible(); + expect(screen.queryByLabelText(/authenticator app/i)).toBeVisible(); }); }); diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.story.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.story.tsx index da707ef1445f6..3cbde51f69c79 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.story.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.story.tsx @@ -20,11 +20,12 @@ import React from 'react'; import Dialog from 'design/Dialog'; +import { Attempt } from 'shared/hooks/useAttemptNext'; + import { createTeleportContext } from 'teleport/mocks/contexts'; import { ContextProvider } from 'teleport/index'; import { - DeviceType, MFA_OPTION_SSO_DEFAULT, MFA_OPTION_TOTP, MFA_OPTION_WEBAUTHN, @@ -36,7 +37,6 @@ import { DeleteDeviceStep, } from './DeleteAuthDeviceWizard'; import { ReauthenticateStep } from './ReauthenticateStep'; -import { Attempt } from 'shared/hooks/useAttemptNext'; export default { title: 'teleport/Account/Manage Devices/Delete Device Wizard', @@ -121,5 +121,5 @@ const stepProps: DeleteAuthDeviceWizardStepProps = { MFA_OPTION_TOTP, MFA_OPTION_SSO_DEFAULT, ], - submitWithMfa: async (mfaType?: DeviceType, otpCode?: string) => {}, + submitWithMfa: async () => {}, }; diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.test.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.test.tsx index e51c5cf15df30..76bfd5d72e5d9 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.test.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.test.tsx @@ -19,7 +19,7 @@ import { render, screen } from 'design/utils/testing'; import React from 'react'; -import { waitFor, within } from '@testing-library/react'; +import { waitFor } from '@testing-library/react'; import { userEvent, UserEvent } from '@testing-library/user-event'; import TeleportContext from 'teleport/teleportContext'; @@ -29,7 +29,7 @@ import auth from 'teleport/services/auth'; import { DeleteAuthDeviceWizardStepProps } from './DeleteAuthDeviceWizard'; -import { dummyPasskey, dummyHardwareDevice, deviceCases } from './deviceCases'; +import { dummyPasskey, dummyHardwareDevice } from './deviceCases'; import { DeleteAuthDeviceWizard } from '.'; @@ -73,14 +73,13 @@ function TestWizard(props: Partial) { test('deletes a device with WebAuthn reauthentication', async () => { render(); - let reauthenticateStep; await waitFor(() => { - reauthenticateStep = within(screen.getByTestId('reauthenticate-step')); + expect(screen.getByTestId('reauthenticate-step')).toBeInTheDocument(); }); - await user.click(reauthenticateStep.getByText('Verify my identity')); + await user.click(screen.getByText('Verify my identity')); - const deleteStep = within(screen.getByTestId('delete-step')); - await user.click(deleteStep.getByRole('button', { name: 'Delete' })); + expect(screen.getByTestId('delete-step')).toBeInTheDocument(); + await user.click(screen.getByRole('button', { name: 'Delete' })); expect(ctx.mfaService.removeDevice).toHaveBeenCalledWith( 'privilege-token', @@ -92,19 +91,15 @@ test('deletes a device with WebAuthn reauthentication', async () => { test('deletes a device with OTP reauthentication', async () => { render(); - let reauthenticateStep; await waitFor(() => { - reauthenticateStep = within(screen.getByTestId('reauthenticate-step')); + expect(screen.getByTestId('reauthenticate-step')).toBeInTheDocument(); }); - await user.click(reauthenticateStep.getByText('Authenticator App')); - await user.type( - reauthenticateStep.getByLabelText('Authenticator Code'), - '654987' - ); - await user.click(reauthenticateStep.getByText('Verify my identity')); + await user.click(screen.getByText('Authenticator App')); + await user.type(screen.getByLabelText('Authenticator Code'), '654987'); + await user.click(screen.getByText('Verify my identity')); - const deleteStep = within(screen.getByTestId('delete-step')); - await user.click(deleteStep.getByRole('button', { name: 'Delete' })); + expect(screen.getByTestId('delete-step')).toBeInTheDocument(); + await user.click(screen.getByRole('button', { name: 'Delete' })); expect(ctx.mfaService.removeDevice).toHaveBeenCalledWith( 'privilege-token', @@ -130,13 +125,13 @@ test.each([ async ({ device, title, message }) => { render(); - const reauthenticateStep = await waitFor(() => { - return within(screen.getByTestId('reauthenticate-step')); + await waitFor(() => { + expect(screen.getByTestId('reauthenticate-step')).toBeInTheDocument(); }); - await user.click(reauthenticateStep.getByText('Verify my identity')); + await user.click(screen.getByText('Verify my identity')); - const deleteStep = within(screen.getByTestId('delete-step')); - expect(deleteStep.getByText(title)).toBeVisible(); - expect(deleteStep.getByText(message)).toBeVisible(); + expect(screen.getByTestId('delete-step')).toBeInTheDocument(); + expect(screen.getByText(title)).toBeVisible(); + expect(screen.getByText(message)).toBeVisible(); } ); diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.tsx index df51e825c4051..dcd6f4d910e15 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/DeleteAuthDeviceWizard.tsx @@ -38,11 +38,12 @@ import { MfaDevice } from 'teleport/services/mfa'; import useReAuthenticate from 'teleport/components/ReAuthenticate/useReAuthenticate'; +import auth, { MfaChallengeScope } from 'teleport/services/auth/auth'; + import { ReauthenticateStep, ReauthenticateStepProps, } from './ReauthenticateStep'; -import auth, { MfaChallengeScope } from 'teleport/services/auth/auth'; interface DeleteAuthDeviceWizardProps { /** Device to be removed. */ diff --git a/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.tsx b/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.tsx index c36e133e73c7b..806d54c910919 100644 --- a/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.tsx +++ b/web/packages/teleport/src/Account/ManageDevices/wizards/ReauthenticateStep.tsx @@ -20,7 +20,7 @@ import { OutlineDanger } from 'design/Alert/Alert'; import { ButtonPrimary, ButtonSecondary } from 'design/Button'; import Flex from 'design/Flex'; import { RadioGroup } from 'design/RadioGroup'; -import React, { useState, FormEvent, useEffect } from 'react'; +import React, { useState, FormEvent } from 'react'; import FieldInput from 'shared/components/FieldInput'; import Validation, { Validator } from 'shared/components/Validation'; import { requiredField } from 'shared/components/Validation/rules'; diff --git a/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.tsx b/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.tsx index bf107c81164ea..a202663b5daa7 100644 --- a/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.tsx +++ b/web/packages/teleport/src/components/ReAuthenticate/ReAuthenticate.story.tsx @@ -18,13 +18,14 @@ import React from 'react'; -import { ReAuthenticate, State } from './ReAuthenticate'; import { MFA_OPTION_SSO_DEFAULT, MFA_OPTION_TOTP, MFA_OPTION_WEBAUTHN, } from 'teleport/services/mfa'; +import { ReAuthenticate, State } from './ReAuthenticate'; + export default { title: 'Teleport/ReAuthenticate', }; diff --git a/web/packages/teleport/src/services/auth/auth.ts b/web/packages/teleport/src/services/auth/auth.ts index a818eda3e1f5b..c6c9ea277846d 100644 --- a/web/packages/teleport/src/services/auth/auth.ts +++ b/web/packages/teleport/src/services/auth/auth.ts @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import { Auth2faType } from 'shared/services'; - import api from 'teleport/services/api'; import cfg from 'teleport/config'; import {