Selaa lähdekoodia

- Fixed auth header and fixed event type

Parad0x 5 vuotta sitten
vanhempi
commit
2bc01b54c1
2 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 4 1
      app/src/web/TwitchPubSug.ts
  2. 1 1
      app/src/web/utils/translateTwitchUser.ts

+ 4 - 1
app/src/web/TwitchPubSug.ts

@@ -46,8 +46,11 @@ export interface MesageEvent {
         topic: string
     }
 }
+export interface PongEvent {
+    type: "PONG"
+}
 
-export type TwitchEvent = MesageEvent & ResponseEvent
+export type TwitchEvent = MesageEvent | ResponseEvent | PongEvent
 
 declare interface Twitch {
     on(event: "reward", listner: (reward: PointsRedeemed)=>void): this;

+ 1 - 1
app/src/web/utils/translateTwitchUser.ts

@@ -7,7 +7,7 @@ export default async function translateTwitchUser(user: string): Promise<string>
         method: "GET",
         headers: {
             "Client-ID": window.settings.options.twitch_client_id,
-            "Authorization": "OAuth "+window.settings.options.twitch_oauth_token
+            "Authorization": "Bearer "+window.settings.options.twitch_oauth_token
         }
     });
     let userData = await response.json();