Sfoglia il codice sorgente

Fixed oauth window

Parad0x 5 anni fa
parent
commit
b37740c9c1
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      app/src/OAuthWindow.ts

+ 8 - 0
app/src/OAuthWindow.ts

@@ -24,7 +24,15 @@ function formatUrl(
 }
 
 function parseTwitchRedirect(twitchUrl: string): string{
+    if(!twitchUrl.startsWith("http://localhost")){
+        return "";
+    }
+    
     let parsed = url.parse(twitchUrl);
+
+    if(!parsed.hash){
+        return "";
+    }
     let query = querystring.parse(parsed.hash.slice(1));
     if(isString(query["access_token"])){
         return query["access_token"];