feat(mcp): add OAuth 2.1 support (#505)

* feat(mcp): add OAuth 2.1 support with dynamic client registration

* feat(api): alias bare oauth-authorization-server discovery endpoint

* fix(auth): preserve user session on OAuth sign-in redirect to consent
This commit is contained in:
Yiling-J
2026-10-29 15:39:37 +08:00
committed by GitHub
parent 96539207d0
commit baf30730af
39 changed files with 19604 additions and 44 deletions
+5 -1
View File
@@ -1,8 +1,12 @@
import { createAuthClient } from 'better-auth/react'
import { oauthProviderClient } from '@better-auth/oauth-provider/client'
export const authClient = createAuthClient({
// eslint-disable-next-line @typescript-eslint/naming-convention
baseURL: window.location.origin,
baseURL: typeof window !== 'undefined' ? window.location.origin : '',
plugins: [oauthProviderClient()],
})
export const getAuthSession = async () => authClient.getSession()
export const { signIn, signUp, useSession, signOut, resetPassword } = authClient