mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-09 21:16:48 +03:00
Added Better Auth
This commit is contained in:
22
src/lib/auth-client.ts
Normal file
22
src/lib/auth-client.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { createAuthClient } from "better-auth/react";
|
||||
|
||||
export const authClient = createAuthClient({
|
||||
// The base URL is optional when running on the same domain
|
||||
// Better Auth will use the current domain by default
|
||||
});
|
||||
|
||||
// Export commonly used methods for convenience
|
||||
export const {
|
||||
signIn,
|
||||
signUp,
|
||||
signOut,
|
||||
useSession,
|
||||
sendVerificationEmail,
|
||||
resetPassword,
|
||||
requestPasswordReset,
|
||||
getSession
|
||||
} = authClient;
|
||||
|
||||
// Export types
|
||||
export type Session = Awaited<ReturnType<typeof authClient.getSession>>["data"];
|
||||
export type AuthUser = Session extends { user: infer U } ? U : never;
|
||||
Reference in New Issue
Block a user