Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Conversation

@ocket8888
Copy link
Contributor

@ocket8888 ocket8888 commented Feb 1, 2023

Fixes #7317: Login redirect is broken because it can't handle query string parameters. This PR fixes it so unauthenticated users are directed back where they were trying to go after logging in.


Which Traffic Control components are affected by this PR?

  • Traffic Portal (experimental v2)

What is the best way to verify this PR?

Assuming you have Traffic Ops running locally on port 6443, run ng serve in the TPv2 directory, then open the URL http://localhost:4200/core/servers?search=test in a new private browsing context (or just any context where you aren't already authenticated). It should send you back to the login page, then after logging in that should take you to the servers table with the search field set to the string "text".

If this is a bugfix, which Traffic Control versions contained the bug?

  • master

PR submission checklist

  • This PR uses existing tests
  • This PR doesn't need documentation
  • This PR doesn't need a CHANGELOG.md entry
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY

@ocket8888 ocket8888 added bug something isn't working as intended low impact affects only a small portion of a CDN, and cannot itself break one experimental a feature/component not directly supported by ATC Traffic Portal v2 Related to the experimental Traffic Portal version 2 labels Feb 1, 2023
That's a problem because it crashes the component, but what it should do
when given a bad token is just drop you to login.
Copy link
Contributor

@rimashah25 rimashah25 left a comment

Choose a reason for hiding this comment

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

Issue has been fixed. The dashboard page no longer is seen if the user is unauthorized.

@zrhoffman zrhoffman merged commit f07dd03 into apache:master Feb 7, 2023
@ocket8888 ocket8888 deleted the tpv2/redirect-fix branch February 7, 2023 21:24
@shamrickus
Copy link
Member

shamrickus commented Apr 11, 2023

This is definitely still broken. Going to any page when unauthenticated will not bring you to the login screen. Not sure if login redirects are still broken as it's not properly moving.

@ocket8888
Copy link
Contributor Author

ocket8888 commented Apr 11, 2023

Going to any page when authenticated will not bring you to the login screen.

... that's the correct behavior, though, no?

@shamrickus
Copy link
Member

shamrickus commented Apr 11, 2023

when not authenticated, woops edited.

@ocket8888
Copy link
Contributor Author

I can't reproduce that. I just opened it to http://localhost:4200/core/cdns in a new private browsing context and got redirected to login. What doesn't work is actually redirecting afterwards. Since the core module isn't loaded until after authentication, there is no routing available under /core/ at the time that the user logs in, so it can't navigate.

@shamrickus
Copy link
Member

I think you are correct, the issue I was seeing occurs when you leave TP open and let the cookie expire naturally. It will then redirect the user to https://{TPURL}, which is just a blank screen with the sidebar shown as opposed to the login screen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug something isn't working as intended experimental a feature/component not directly supported by ATC low impact affects only a small portion of a CDN, and cannot itself break one Traffic Portal v2 Related to the experimental Traffic Portal version 2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Return URL" in TPv2 broken

4 participants