From 261d6d5215bed6e79924ad341e970811ff33ffda Mon Sep 17 00:00:00 2001 From: John Costa Date: Mon, 30 Jun 2025 19:03:00 +0100 Subject: [PATCH] fix --- src/lib/twitch.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/twitch.ts b/src/lib/twitch.ts index 4ad8ff8..b585e83 100644 --- a/src/lib/twitch.ts +++ b/src/lib/twitch.ts @@ -1,3 +1,4 @@ +import { building } from "$app/environment"; import { HASH_SECRET, TWITCH_APP_CLIENT_ID, TWITCH_APP_SECRET } from "$env/static/private"; import { z } from "zod"; @@ -42,6 +43,10 @@ export const twitchFollowEvent = z.object({ // Webhook -> Redeem of channel reward export const createTwitchClient = () => { const getAccessToken = async () => { + if (building) { + return ''; + } + const authUrl = `https://id.twitch.tv/oauth2/authorize` + `?response_type=code` + `&client_id=${TWITCH_APP_CLIENT_ID}` + @@ -71,7 +76,6 @@ export const createTwitchClient = () => { const _access_token = getAccessToken(); const subscribeToFollow = async () => { - console.log(await _access_token); const twitchSubResponse = await fetch( "https://api.twitch.tv/helix/eventsub/subscriptions", {