mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 19:17:38 +00:00
* 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
13 lines
499 B
TypeScript
13 lines
499 B
TypeScript
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: typeof window !== 'undefined' ? window.location.origin : '',
|
|
plugins: [oauthProviderClient()],
|
|
})
|
|
|
|
export const getAuthSession = async () => authClient.getSession()
|
|
|
|
export const { signIn, signUp, useSession, signOut, resetPassword } = authClient
|