pyroscope
pyroscope copied to clipboard
Oauth: make it so that you get redirected to the proper page after login
Currently if a user opens a pyroscope link (e.g /?query=cart.service.dotnet.cpu%7B%7D
) and they are not authenticated, we redirect them to oauth authentication flow. After they're done we redirect them to /
, thus losing the original URL they were trying to open. We should preserve that original URL and redirect to it after the user is done with the login flow.
I'm thinking maybe when we do the redirect we could preserve the URL in a cookie (or localstorage) and then after login we could check if this cookie exists and redirect.
I think another important thing with this feature is tests — ideally a cypress test to confirm that this stuff works, because I imagine we might change the authentication flow in the future.