diff --git a/changelog.d/20240822_134319_roman_rm_login_with_token.md b/changelog.d/20240822_134319_roman_rm_login_with_token.md new file mode 100644 index 000000000000..45d1631c8931 --- /dev/null +++ b/changelog.d/20240822_134319_roman_rm_login_with_token.md @@ -0,0 +1,4 @@ +### Removed + +- Removed the `/auth/login-with-token` page + () diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 89baa2e1dfa9..4f46788fb2a9 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.64.6", + "version": "1.65.0", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { diff --git a/cvat-ui/src/components/cvat-app.tsx b/cvat-ui/src/components/cvat-app.tsx index c9ebea4d12ea..1282ac21bcaf 100644 --- a/cvat-ui/src/components/cvat-app.tsx +++ b/cvat-ui/src/components/cvat-app.tsx @@ -17,7 +17,6 @@ import Text from 'antd/lib/typography/Text'; import LogoutComponent from 'components/logout-component'; import LoginPageContainer from 'containers/login-page/login-page'; -import LoginWithTokenComponent from 'components/login-with-token/login-with-token'; import RegisterPageContainer from 'containers/register-page/register-page'; import ResetPasswordPageConfirmComponent from 'components/reset-password-confirm-page/reset-password-confirm-page'; import ResetPasswordPageComponent from 'components/reset-password-page/reset-password-page'; @@ -501,11 +500,6 @@ class CVATApplication extends React.PureComponent - @@ -590,11 +584,6 @@ class CVATApplication extends React.PureComponent - {isPasswordResetEnabled && ( )} diff --git a/cvat-ui/src/components/login-with-token/login-with-token.tsx b/cvat-ui/src/components/login-with-token/login-with-token.tsx deleted file mode 100644 index bdfbdbf5244d..000000000000 --- a/cvat-ui/src/components/login-with-token/login-with-token.tsx +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2020-2022 Intel Corporation -// Copyright (C) 2022-2023 CVAT.ai Corporation -// -// SPDX-License-Identifier: MIT - -import React, { useEffect } from 'react'; -import LoadingSpinner from 'components/common/loading-spinner'; -import { useParams, useLocation } from 'react-router'; - -export default function LoginWithTokenComponent(): JSX.Element { - const location = useLocation(); - const { token } = useParams<{ token: string }>(); - const search = new URLSearchParams(location.search); - - useEffect( - () => { - localStorage.setItem('token', token); - const next = search.get('next') ?? '/'; - (window as Window).location = next; - }, - [token], - ); - - return (); -} diff --git a/tests/cypress/e2e/actions_users/issue_1810_login_logout.js b/tests/cypress/e2e/actions_users/issue_1810_login_logout.js index 391c04b1a1f8..8f7b7e368679 100644 --- a/tests/cypress/e2e/actions_users/issue_1810_login_logout.js +++ b/tests/cypress/e2e/actions_users/issue_1810_login_logout.js @@ -58,24 +58,6 @@ context('When clicking on the Logout button, get the user session closed.', () = cy.contains('.cvat-task-details-task-name', `${taskName}`).should('be.visible'); }); - it('Logout and login to task via token', () => { - cy.logout(); - // get token and login to task - cy.request({ - method: 'POST', - url: '/api/auth/login', - body: { - username: Cypress.env('user'), - email: Cypress.env('email'), - password: Cypress.env('password'), - }, - }).then(async (response) => { - const token = response.body.key; - cy.visit(`/auth/login-with-token/${token}?next=/tasks/${taskId}`); - cy.contains('.cvat-task-details-task-name', `${taskName}`).should('be.visible'); - }); - }); - it('Login via email', () => { cy.logout(); login(Cypress.env('email'), Cypress.env('password'));