mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-22 09:37:48 +08:00
Drop the event source if we are unauthorized (#15275)
A previous commit that sent unauthorized if the user is unauthorized simply leads to the repeated reopening of the eventsource. # This PR changes the event returned to tell the client to close the eventsource and thus prevents the repeated reopening. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
@ -74,6 +74,11 @@ export async function initNotificationCount() {
|
||||
});
|
||||
worker.port.close();
|
||||
window.location.href = AppSubUrl;
|
||||
} else if (event.data.type === 'close') {
|
||||
worker.port.postMessage({
|
||||
type: 'close',
|
||||
});
|
||||
worker.port.close();
|
||||
}
|
||||
});
|
||||
worker.port.addEventListener('error', (e) => {
|
||||
|
Reference in New Issue
Block a user