mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-07 04:19:22 +00:00
feat: MCP plugin (#2666)
* chore: wip * wip * feat: mcp plugin * wip * chore: fix lock file * clean up * schema * docs * chore: lint * chore: release v1.2.9-beta.1 * blog * chore: lint
This commit is contained in:
@@ -8,8 +8,8 @@ import {
|
||||
oneTap,
|
||||
oAuthProxy,
|
||||
openAPI,
|
||||
oidcProvider,
|
||||
customSession,
|
||||
mcp,
|
||||
} from "better-auth/plugins";
|
||||
import { reactInvitationEmail } from "./email/invitation";
|
||||
import { LibsqlDialect } from "@libsql/kysely-libsql";
|
||||
@@ -19,9 +19,9 @@ import { MysqlDialect } from "kysely";
|
||||
import { createPool } from "mysql2/promise";
|
||||
import { nextCookies } from "better-auth/next-js";
|
||||
import { passkey } from "better-auth/plugins/passkey";
|
||||
import { expo } from "@better-auth/expo";
|
||||
import { stripe } from "@better-auth/stripe";
|
||||
import { Stripe } from "stripe";
|
||||
import Database from "better-sqlite3";
|
||||
|
||||
const from = process.env.BETTER_AUTH_EMAIL || "delivered@resend.dev";
|
||||
const to = process.env.TEST_EMAIL || "";
|
||||
@@ -52,10 +52,7 @@ const STARTER_PRICE_ID = {
|
||||
|
||||
export const auth = betterAuth({
|
||||
appName: "Better Auth Demo",
|
||||
database: {
|
||||
dialect,
|
||||
type: process.env.USE_MYSQL ? "mysql" : "sqlite",
|
||||
},
|
||||
database: new Database("auth.db"),
|
||||
emailVerification: {
|
||||
async sendVerificationEmail({ user, url }) {
|
||||
const res = await resend.emails.send({
|
||||
@@ -117,6 +114,9 @@ export const auth = betterAuth({
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
mcp({
|
||||
loginPage: "/sign-in",
|
||||
}),
|
||||
organization({
|
||||
async sendInvitationEmail(data) {
|
||||
await resend.emails.send({
|
||||
@@ -160,9 +160,7 @@ export const auth = betterAuth({
|
||||
multiSession(),
|
||||
oAuthProxy(),
|
||||
nextCookies(),
|
||||
oidcProvider({
|
||||
loginPage: "/sign-in",
|
||||
}),
|
||||
|
||||
oneTap(),
|
||||
customSession(async (session) => {
|
||||
return {
|
||||
@@ -198,7 +196,6 @@ export const auth = betterAuth({
|
||||
],
|
||||
},
|
||||
}),
|
||||
expo(),
|
||||
],
|
||||
trustedOrigins: ["exp://"],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user