2026-05-19 16:05:09 +08:00
|
|
|
import { createAuthClient } from 'better-auth/react'
|
2026-10-29 15:39:37 +08:00
|
|
|
import { oauthProviderClient } from '@better-auth/oauth-provider/client'
|
2026-05-19 16:05:09 +08:00
|
|
|
|
|
|
|
|
export const authClient = createAuthClient({
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
2026-10-29 15:39:37 +08:00
|
|
|
baseURL: typeof window !== 'undefined' ? window.location.origin : '',
|
|
|
|
|
plugins: [oauthProviderClient()],
|
2026-05-19 16:05:09 +08:00
|
|
|
})
|
|
|
|
|
|
2026-10-29 15:39:37 +08:00
|
|
|
export const getAuthSession = async () => authClient.getSession()
|
|
|
|
|
|
2026-08-25 14:35:33 +08:00
|
|
|
export const { signIn, signUp, useSession, signOut, resetPassword } = authClient
|