diff --git a/src/hooks.client.ts b/src/hooks.client.ts index 8b39c93..1ed86d2 100644 --- a/src/hooks.client.ts +++ b/src/hooks.client.ts @@ -2,15 +2,13 @@ import { handleErrorWithSentry, replayIntegration } from '@sentry/sveltekit'; import * as Sentry from '@sentry/sveltekit'; Sentry.init({ - dsn: process.env.SENTRY_DSN, + dsn: 'https://7caab434460a1585f4c87baa1a692427@o40609.ingest.us.sentry.io/4510461147742208', tracesSampleRate: 1.0, // Enable logs to be sent to Sentry enableLogs: true, - environment: process.env.SENTRY_ENVIRONMENT, - // This sets the sample rate to be 10%. You may want this to be 100% while // in development and sample at a lower rate in production replaysSessionSampleRate: 0.1, diff --git a/src/instrumentation.server.ts b/src/instrumentation.server.ts index 4a430b2..4c96612 100644 --- a/src/instrumentation.server.ts +++ b/src/instrumentation.server.ts @@ -1,7 +1,9 @@ import * as Sentry from '@sentry/sveltekit'; Sentry.init({ - dsn: process.env.SENTRY_DSN, + dsn: 'https://7caab434460a1585f4c87baa1a692427@o40609.ingest.us.sentry.io/4510461147742208', + + integrations: [Sentry.consoleLoggingIntegration({ levels: ['log', 'warn', 'error'] })], tracesSampleRate: 1.0, @@ -13,3 +15,5 @@ Sentry.init({ // uncomment the line below to enable Spotlight (https://spotlightjs.com) // spotlight: import.meta.env.DEV, }); + +export const handleError = Sentry.handleErrorWithSentry(); diff --git a/src/routes/auth/callback/+server.ts b/src/routes/auth/callback/+server.ts index 70258c1..bbc2013 100644 --- a/src/routes/auth/callback/+server.ts +++ b/src/routes/auth/callback/+server.ts @@ -97,6 +97,8 @@ export async function GET(event) { const slackProfileResJSON = await slackProfileRes.json(); if (!slackProfileResJSON.ok) { + console.error('Failed to fetch user profile'); + const redirectURL = new URL(`${url.protocol}//${url.host}/auth/failed`); return redirect(302, redirectURL); } @@ -121,6 +123,8 @@ export async function GET(event) { const channelMembersResJSON = await channelMembersRes.json(); if (!channelMembersResJSON.ok) { + console.error('Failed to fetch channel members'); + const redirectURL = new URL(`${url.protocol}//${url.host}/auth/failed`); return redirect(302, redirectURL); } diff --git a/vite.config.ts b/vite.config.ts index 6c0f957..789a225 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,7 +8,8 @@ export default defineConfig({ sentrySvelteKit({ sourceMapsUploadOptions: { org: 'hack-club', - project: 'construct' + project: 'construct', + authToken: process.env.SENTRY_AUTH_TOKEN } }), tailwindcss(),