Skip to content

armgit / crm

Public Imported from GitHub
0

Comp AI CRM is an open source, CRM designed for AI agents. Agentic-first CRM.

TypeScript
533 B
Raw Blame
import type { BetterAuthPlugin } from "better-auth";
import { createAuthEndpoint } from "better-auth/api";

export const slackOAuthCallback = {
	id: "slack-oauth-callback",
	endpoints: {
		legacySlackCallback: createAuthEndpoint(
			"/oauth2/callback/slack",
			{ method: "GET", requireRequest: true },
			async (ctx) => {
				const target = new URL(`${ctx.context.baseURL}/callback/slack`);
				target.search = new URL(ctx.request.url).search;
				throw ctx.redirect(target.toString());
			},
		),
	},
} satisfies BetterAuthPlugin;