瀏覽代碼

Fixed oauth window

Parad0x 5 年之前
父節點
當前提交
b37740c9c1
共有 1 個文件被更改,包括 8 次插入0 次删除
  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"];