Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect query param #2527

Merged
merged 8 commits into from
Dec 9, 2020
Merged

Redirect query param #2527

merged 8 commits into from
Dec 9, 2020

Conversation

ActiveChooN
Copy link
Contributor

@ActiveChooN ActiveChooN commented Dec 3, 2020

Motivation and context

This PR provide redirect parameter for auth page for redirecting after sucessfull login.

How has this been tested?

Manually

Test scenarios

  1. Create some task if not existed
  2. Logout and go to /tasks/<task_id> it will redirect to /auth/login?next=/tasks/<task_id>
  3. Login
  4. Check correct task is opened

Using token login add parameter next manually: /login-with-token/:sessionId/:csrfToken?next=/tasks/<task_id>

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

@coveralls
Copy link

coveralls commented Dec 4, 2020

Coverage Status

Coverage decreased (-0.03%) to 61.824% when pulling e9fc542 on dk/login-redirect into be93804 on develop.

@@ -24,7 +26,7 @@ export default function LoginWithTokenComponent(): JSX.Element {
);

if (cookies.sessionid && cookies.csrftoken) {
return <Redirect to='/tasks' />;
return <Redirect to={redirectParam || '/tasks'} />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redirection works fine at first time.
Unfortunately when user is already loged in {cookies are set} It does not redirect to requested page any more

Copy link
Member

@bsekachev bsekachev Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @tdowgiel
Please, try another implementation according to updated PR description.

Copy link
Contributor

@tdowgiel tdowgiel Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Thanks for the update.
Tested on Chrome 87 - macOS (Big Sur) and Windows 10
Unfortunately issue mentioned before still persists:

Steps to reproduce:
1.
Action:
Login to CVAT using ?nexto fo example http://auth/login-with-token/aj52qlbiux7manf8xwkz9etz1ivg8atk/nR9CeVzrL0AZMh8ZuAEzBr6swCeWUVbWT6KfScBbNuCMUW4dU1tU50tKb7ofUp9B?next=/tasks/1
Expecteted and Actual result:
CVAT is logged and page is redirected to /tasks/1
2.
Action:
Open new browser tab and past link once again:
Expected result:
CVAT is logged and page is redirected to /tasks/1
Actual result:
CVAT is logged but page is redirected to /tasks

Regards

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tdowgiel
I thought you told about login with UI elements (twice or more) with the redirection query parameter. Anyway, looks like we fixed also login with a token.

@bsekachev bsekachev merged commit 76ff7ef into develop Dec 9, 2020
@bsekachev bsekachev deleted the dk/login-redirect branch December 9, 2020 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants