Bug #17101

Updated by Peter Amstutz about 1 year ago

The user can copy the wb2 path (a project or collection) from the URL bar and send it to another user. The 2nd user clicks on it, but need to log in. After the user logs in, they are shown the default starting view, not the project or collection they intended to visit.

Fixing this will make it easier for users to share URLs to collections, as well as making the implementation of "copy to clipboard" and "open in new tab" for projects/collections much simpler.

This happens because the AuthService.login (src/services/auth-service/auth-service.ts) method does not record the path that the user intended to navigate to. It sends the user to the 3rd party login, and the token is returned by redirecting the browser to the /token endpoint, which saves the token, and then the user is shown the default page.

The login method should provides a means of returning to the desired location. This means stashing the current path and query parameters in one of two places:

* embedded in the URL that will be sent to the login server as return_to.
The way return_to is used is that the upstream Arvados API server redirects the browser to the URL in "return_to" and adds "api_token=xxx" query parameter. This would require check for "api_token" in the query during initialization and not just when navigating to the "token" endpoint.

* browser storage (session storage?) so that when returning to the page, it restores the original path and query.