refactor: update better-auth configuration and clean up code
- Changed the version of "better-auth" to use a catalog reference in package.json and bun.lock for better dependency management. - Removed unnecessary comments and cleaned up the code in various files to enhance readability and maintainability. - Updated the authentication handling in hooks.server.ts to ensure proper token retrieval. - Simplified the layout and structure of Svelte components for improved clarity and performance.
This commit is contained in:
9
apps/web/src/routes/(dashboard)/+layout.server.ts
Normal file
9
apps/web/src/routes/(dashboard)/+layout.server.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { api } from "@sgse-app/backend/convex/_generated/api";
|
||||
import { createConvexHttpClient } from "@mmailaender/convex-better-auth-svelte/sveltekit";
|
||||
|
||||
export const load = async ({ locals }) => {
|
||||
const client = createConvexHttpClient({ token: locals.token });
|
||||
|
||||
const currentUser = await client.query(api.auth.getCurrentUser, {});
|
||||
return { currentUser };
|
||||
};
|
||||
Reference in New Issue
Block a user