fix: terminal auth — skip pre-emptive refresh, always refresh on app load for fresh cookies
This commit is contained in:
@@ -266,18 +266,14 @@
|
||||
}
|
||||
|
||||
async function connect(forceRefresh = false) {
|
||||
// Always refresh token before first connection to ensure fresh cookies
|
||||
let d = tabData.get(tabId);
|
||||
const isFirstConnect = !d?.hasConnectedOnce;
|
||||
|
||||
if (forceRefresh || isFirstConnect) {
|
||||
if (forceRefresh) {
|
||||
const refreshed = await tryRefreshSession();
|
||||
if (!refreshed) {
|
||||
handleAuthExpired();
|
||||
return null;
|
||||
}
|
||||
// Mark that we've connected once with fresh token
|
||||
if (d) d.hasConnectedOnce = true;
|
||||
}
|
||||
|
||||
const ws = new WebSocket(
|
||||
|
||||
Reference in New Issue
Block a user