sdefresne / gerrit-monitor

Source for Gerrit Monitor Chrome extension
Apache License 2.0
21 stars 16 forks source link

Retry failed Gerrit requests when auth tokens have timed out #10

Closed davidgreenaway closed 5 years ago

davidgreenaway commented 5 years ago

Some Gerrit instances attempt to redirect the user via an authentication server every few hours to refresh some cookies. Such redirects will fail, due to Chrome's CORS restrictions.

In these cases, we can attempt to send an opaque request (with mode: no-cors) that will successfully redirect via the authentication server and refresh any cookies, and then send the original request again.

This won't solve cases where a user needs to type in a password, but will allow GerritMonitor to continue working if the problem is simply an authentication cookie refresh was required.