Parcourir la source

Fixed oauth window

Parad0x il y a 5 ans
Parent
commit
b37740c9c1
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  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"];