diff --git a/apps/server/src/api/v2/slack/index.ts b/apps/server/src/api/v2/slack/index.ts index 3d244d4a0..4e2949535 100644 --- a/apps/server/src/api/v2/slack/index.ts +++ b/apps/server/src/api/v2/slack/index.ts @@ -19,7 +19,7 @@ import { updateIntegrationHandler } from './update-integration'; const app = new Hono() // Public endpoints (no auth required for OAuth flow) - .post('/auth/init', requireAuth, zValidator('json', z.object({}).merge(InitiateOAuthSchema.unwrap())), initiateOAuthHandler) + .post('/auth/init', requireAuth, zValidator('json', InitiateOAuthSchema), initiateOAuthHandler) .get('/auth/callback', handleOAuthCallbackHandler) // Protected endpoints .get('/integration', requireAuth, getIntegrationHandler) diff --git a/apps/server/src/api/v2/slack/initiate-oauth.ts b/apps/server/src/api/v2/slack/initiate-oauth.ts index c3369f3de..eb01e9d86 100644 --- a/apps/server/src/api/v2/slack/initiate-oauth.ts +++ b/apps/server/src/api/v2/slack/initiate-oauth.ts @@ -46,7 +46,7 @@ export async function initiateOAuthHandler(c: Context): Promise { throw new HTTPException(400, { message: 'Organization not found' }); } - const request = c.req.valid('json') as InitiateOAuthRequest; + const request = c.req.valid('json'); const metadata = request?.metadata; const enrichedMetadata = { diff --git a/apps/server/src/api/v2/slack/update-integration.ts b/apps/server/src/api/v2/slack/update-integration.ts index 526ba3a96..258f13136 100644 --- a/apps/server/src/api/v2/slack/update-integration.ts +++ b/apps/server/src/api/v2/slack/update-integration.ts @@ -23,7 +23,7 @@ export async function updateIntegrationHandler(c: Context): Promise { } try { - const request = c.req.valid('json') as UpdateIntegrationRequest; + const request = c.req.valid('json'); const updateData: { defaultChannel?: { id: string; name: string }; diff --git a/packages/server-shared/src/slack/requests.types.ts b/packages/server-shared/src/slack/requests.types.ts index aed09ad9c..63feba058 100644 --- a/packages/server-shared/src/slack/requests.types.ts +++ b/packages/server-shared/src/slack/requests.types.ts @@ -11,17 +11,15 @@ const SlackSharingPermissionEnum: Record;