getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.22k stars 4.21k forks source link

fix(toolbar): Force the correct, subdomained, url when navigating to the toolbar popup #81107

Closed ryan953 closed 7 hours ago

ryan953 commented 19 hours ago

This is a followup to https://github.com/getsentry/sentry/pull/80003

In #80003 all the redirect and url stuff is still true... but we only do the redirect hop at the end when the user was logged out to begin with. If the user starts off logged in then there's no redirect on the server side and the url that the toolbar asked for inside the popup (https://sentry.io/toolbar/$org/$project/login-success/) will just load.

What's going to happen now: If the user is not logged into sentry already:

  1. Open a popup with url = https://sentry.io/toolbar/$org/$project/login-success/
  2. User redirected into login flow, with ?redirect=.... appended
  3. Login flow completes, user taken to https://$org.sentry.io/toolbar/$org/$project/login-success/ inside the popup
  4. Popup can communicate with the iframe ✅

If the user is already logged into sentry:

  1. Open a popup with url = https://sentry.io/toolbar/$org/$project/login-success/
  2. https://sentry.io/toolbar/$org/$project/login-success/ loads as requested
  3. NEW-> javascript redirect to https://$org.sentry.io/toolbar/$org/$project/login-success/ inside the popup
  4. Popup can communicate with the iframe ✅
codecov[bot] commented 17 hours ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:white_check_mark: All tests successful. No failed tests found.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #81107 +/- ## ========================================== - Coverage 78.49% 78.48% -0.02% ========================================== Files 7215 7215 Lines 319812 319811 -1 Branches 44045 44046 +1 ========================================== - Hits 251040 251000 -40 - Misses 62387 62414 +27 - Partials 6385 6397 +12 ```