MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / pollOAuthStatus

Function pollOAuthStatus

web/js/api-key-dialog.js:326–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

324}
325
326function pollOAuthStatus() {
327 const interval = setInterval(async () => {
328 const res = await fetch("/api/oauth/status");
329 const { connected } = await res.json();
330 if (connected) {
331 clearInterval(interval);
332 updateOAuthUI(true);
333 state.config.oauthConnected = true;
334 state.restartRequired = true;
335 updateApiKeyButton();
336 refreshWebSocketConnectionPreference();
337 setStatus("Connected successfully!", "success");
338 updateRestartButton(true);
339 }
340 }, 2000);
341
342 // Timeout after 5 minutes
343 setTimeout(() => clearInterval(interval), 300000);
344}
345
346function updateOAuthUI(connected) {
347 if (connected) {

Callers 1

handleOAuthLoginFunction · 0.85

Calls 5

updateOAuthUIFunction · 0.85
updateApiKeyButtonFunction · 0.85
setStatusFunction · 0.70
updateRestartButtonFunction · 0.70

Tested by

no test coverage detected