Files
shumai/packages/webui/lib/auth-client.ts
T

13 lines
499 B
TypeScript
Raw Normal View History

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()
export const { signIn, signUp, useSession, signOut, resetPassword } = authClient