created simple auth system using betterauth
This commit is contained in:
5
src/lib/auth-client.ts
Normal file
5
src/lib/auth-client.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { createAuthClient } from "better-auth/react"
|
||||
export const authClient = createAuthClient({
|
||||
/** The base URL of the server (optional if you're using the same domain) */
|
||||
baseURL: "http://localhost:3000"
|
||||
})
|
||||
18
src/lib/auth.ts
Normal file
18
src/lib/auth.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { betterAuth } from "better-auth";
|
||||
import Database from "better-sqlite3";
|
||||
import { localization } from "better-auth-localization";
|
||||
|
||||
|
||||
export const auth = betterAuth({
|
||||
database: new Database("./sqlite_users.db"),
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
},
|
||||
plugins: [
|
||||
|
||||
localization({
|
||||
defaultLocale: "de-DE", // Default to German
|
||||
fallbackLocale: "default" // Fallback to English
|
||||
})
|
||||
]
|
||||
});
|
||||
Reference in New Issue
Block a user