feat: add email sign up
This commit is contained in:
15
src/composables/useAuth.ts
Normal file
15
src/composables/useAuth.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { authClient } from "@/auth";
|
||||
|
||||
export function useAuth() {
|
||||
// Better Auth 提供的 session
|
||||
const session = authClient.useSession();
|
||||
|
||||
const user = computed(() => session.value.data?.user);
|
||||
const isAuthenticated = computed(() => !!session.value.data);
|
||||
|
||||
return {
|
||||
user,
|
||||
session,
|
||||
isAuthenticated,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user