SwissDataScienceCenter / renku-ui

The web frontend of the Renku platform
https://renkulab.io
Apache License 2.0
13 stars 6 forks source link

The LoginRedirect component causes HTTP 500 during the login flow #3338

Closed leafty closed 1 month ago

leafty commented 1 month ago

Using the LoginRedirect component instead of a simple <a href=...> causes the browser to issue a request to /api/data/platform/config just after the browser starts loading the /api/auth/login request. This causes a race condition with sessions and the Set-Cookie header, resulting in a failed authentication flow.

  1. Request to /api/auth/login -> sets the initial cookie value
  2. Request to /api/data/platform/config -> if it happens before receiving the Set-Cookie, will result in a concurrent Set-Cookie being received.
  3. Browser saves to wrong cookie and uses it during the callback stage of the login flow.