refactor: migrate betterauth to local install

also added a login page

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2025-10-05 23:25:20 +00:00
parent f7bc5fd958
commit bf2087cded
23 changed files with 1951 additions and 2376 deletions

View File

@@ -7,6 +7,12 @@ import { createContext, useContext } from "react"
export type AuthErrorCode = keyof typeof authClient.$ERROR_CODES
export class BetterAuthError extends Error {
constructor(public readonly errorCode: AuthErrorCode) {
super(`better-auth error: ${errorCode}`)
}
}
export const authClient = createAuthClient({
baseURL: process.env.BUN_PUBLIC_CONVEX_SITE_URL,
plugins: [convexClient(), crossDomainClient()],