diff --git a/cvat-ui/src/actions/auth-actions.ts b/cvat-ui/src/actions/auth-actions.ts index 0ea9a937..9db70b5a 100644 --- a/cvat-ui/src/actions/auth-actions.ts +++ b/cvat-ui/src/actions/auth-actions.ts @@ -40,7 +40,7 @@ export const authActions = { authorizeSuccess: (user: any) => createAction(AuthActionTypes.AUTHORIZED_SUCCESS, { user }), authorizeFailed: (error: any) => createAction(AuthActionTypes.AUTHORIZED_FAILED, { error }), login: () => createAction(AuthActionTypes.LOGIN), - loginSuccess: (user: any, next: string | null) => createAction(AuthActionTypes.LOGIN_SUCCESS, { user, next }), + loginSuccess: (user: any) => createAction(AuthActionTypes.LOGIN_SUCCESS, { user }), loginFailed: (error: any) => createAction(AuthActionTypes.LOGIN_FAILED, { error }), register: () => createAction(AuthActionTypes.REGISTER), registerSuccess: (user: any) => createAction(AuthActionTypes.REGISTER_SUCCESS, { user }), @@ -98,16 +98,14 @@ export const registerAsync = ( } }; -export const loginAsync = (username: string, password: string, next: string | null): ThunkAction => async ( - dispatch, -) => { +export const loginAsync = (username: string, password: string): ThunkAction => async (dispatch) => { dispatch(authActions.login()); try { await cvat.server.login(username, password); const users = await cvat.users.get({ self: true }); - dispatch(authActions.loginSuccess(users[0], next)); + dispatch(authActions.loginSuccess(users[0])); } catch (error) { dispatch(authActions.loginFailed(error)); } diff --git a/cvat-ui/src/components/cvat-app.tsx b/cvat-ui/src/components/cvat-app.tsx index 8220a603..a7c5079e 100644 --- a/cvat-ui/src/components/cvat-app.tsx +++ b/cvat-ui/src/components/cvat-app.tsx @@ -64,7 +64,6 @@ interface CVATAppProps { authActionsInitialized: boolean; notifications: NotificationsState; user: any; - next: string | null; isModelPluginActive: boolean; } @@ -238,7 +237,6 @@ class CVATApplication extends React.PureComponent )} - + {/* eslint-disable-next-line */} diff --git a/cvat-ui/src/components/login-page/login-page.tsx b/cvat-ui/src/components/login-page/login-page.tsx index 9e00e841..59f92cce 100644 --- a/cvat-ui/src/components/login-page/login-page.tsx +++ b/cvat-ui/src/components/login-page/login-page.tsx @@ -15,7 +15,6 @@ import CookieDrawer from './cookie-policy-drawer'; interface LoginPageComponentProps { fetching: boolean; renderResetPassword: boolean; - next: string; onLogin: (username: string, password: string, next: string | null) => void; } @@ -28,11 +27,7 @@ function LoginPageComponent(props: LoginPageComponentProps & RouteComponentProps xl: { span: 4 }, }; - const { - fetching, onLogin, renderResetPassword, location, - } = props; - - const search = new URLSearchParams(location.search); + const { fetching, onLogin, renderResetPassword } = props; return ( <> @@ -42,7 +37,7 @@ function LoginPageComponent(props: LoginPageComponentProps & RouteComponentProps { - onLogin(loginData.username, loginData.password, search.get('next')); + onLogin(loginData.username, loginData.password); }} /> 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 index b40ca03a..6d896c0d 100644 --- a/cvat-ui/src/components/login-with-token/login-with-token.tsx +++ b/cvat-ui/src/components/login-with-token/login-with-token.tsx @@ -26,7 +26,7 @@ export default function LoginWithTokenComponent(): JSX.Element { ); if (cookies.sessionid && cookies.csrftoken) { - return ; + return ; } return <>; } diff --git a/cvat-ui/src/index.tsx b/cvat-ui/src/index.tsx index 1d527605..31188f77 100644 --- a/cvat-ui/src/index.tsx +++ b/cvat-ui/src/index.tsx @@ -45,7 +45,6 @@ interface StateToProps { allowResetPassword: boolean; notifications: NotificationsState; user: any; - next: string | null; keyMap: Record; isModelPluginActive: boolean; } @@ -92,7 +91,6 @@ function mapStateToProps(state: CombinedState): StateToProps { allowResetPassword: auth.allowResetPassword, notifications: state.notifications, user: auth.user, - next: auth.next, keyMap: shortcuts.keyMap, isModelPluginActive: plugins.list.MODELS, }; diff --git a/cvat-ui/src/reducers/auth-reducer.ts b/cvat-ui/src/reducers/auth-reducer.ts index 2e226c20..54af7c75 100644 --- a/cvat-ui/src/reducers/auth-reducer.ts +++ b/cvat-ui/src/reducers/auth-reducer.ts @@ -10,7 +10,6 @@ const defaultState: AuthState = { initialized: false, fetching: false, user: null, - next: null, authActionsFetching: false, authActionsInitialized: false, allowChangePassword: false, @@ -41,7 +40,6 @@ export default function (state = defaultState, action: AuthActions | BoundariesA ...state, fetching: false, user: action.payload.user, - next: action.payload.next, }; case AuthActionTypes.LOGIN_FAILED: return { diff --git a/cvat-ui/src/reducers/interfaces.ts b/cvat-ui/src/reducers/interfaces.ts index 89217eef..e1b215f9 100644 --- a/cvat-ui/src/reducers/interfaces.ts +++ b/cvat-ui/src/reducers/interfaces.ts @@ -14,7 +14,6 @@ export interface AuthState { initialized: boolean; fetching: boolean; user: any; - next: string | null; authActionsFetching: boolean; authActionsInitialized: boolean; showChangePasswordDialog: boolean;