Skip to content

Commit 5aa740f

Browse files
rajat1saxenaRajat
andauthored
Using better-auth for auth (#684)
* Swapped next-auth with better-auth * Removed deprecate files * Removed next-auth references from code base * feat: update session handling to use `auth.api.getSession` and configure Jest for `better-auth` modules. * Missed mock files * Trusted origin for better-auth * Removed unused vars * Removed deprecated env var * Fixed error message display * Removed unused var --------- Co-authored-by: Rajat <[email protected]>
1 parent d8a7788 commit 5aa740f

File tree

51 files changed

+1446
-748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1446
-748
lines changed

apps/web/__mocks__/better-auth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default jest.fn();

apps/web/__mocks__/next-auth.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { auth } from "@/auth";
2-
import { SessionProvider } from "next-auth/react";
31
import HomepageLayout from "./home-page-layout";
42
import { headers } from "next/headers";
53
import { getFullSiteSetup } from "@ui-lib/utils";
@@ -11,18 +9,11 @@ export default async function Layout({
119
children: React.ReactNode;
1210
}) {
1311
const address = await getAddressFromHeaders(headers);
14-
const [siteInfo, session] = await Promise.all([
15-
getFullSiteSetup(address),
16-
auth(),
17-
]);
12+
const siteInfo = await getFullSiteSetup(address);
1813

1914
if (!siteInfo) {
2015
return null;
2116
}
2217

23-
return (
24-
<SessionProvider session={session}>
25-
<HomepageLayout siteInfo={siteInfo}>{children}</HomepageLayout>
26-
</SessionProvider>
27-
);
18+
return <HomepageLayout siteInfo={siteInfo}>{children}</HomepageLayout>;
2819
}

0 commit comments

Comments
 (0)