mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 22:14:50 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user