Skip to content

Commit a33d10f

Browse files
author
Rajat
committed
Removed next-auth references from code base
1 parent a2f7cf6 commit a33d10f

9 files changed

Lines changed: 9 additions & 132 deletions

File tree

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { SessionProvider } from "next-auth/react";
21
import HomepageLayout from "./home-page-layout";
32
import { headers } from "next/headers";
43
import { getFullSiteSetup } from "@ui-lib/utils";
@@ -10,19 +9,11 @@ export default async function Layout({
109
children: React.ReactNode;
1110
}) {
1211
const address = await getAddressFromHeaders(headers);
13-
const [siteInfo, session] = await Promise.all([
14-
getFullSiteSetup(address),
15-
// auth(),
16-
null,
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
}

apps/web/app/(with-contexts)/layout-with-context.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
} from "@components/contexts";
1919
import { Toaster, useToast } from "@courselit/components-library";
2020
import { TOAST_TITLE_ERROR } from "@ui-config/strings";
21-
// import { Session } from "next-auth";
2221
import { Theme } from "@courselit/page-models";
2322
import { ThemeProvider as NextThemesProvider } from "@components/next-theme-provider";
2423
import { defaultState } from "@components/default-state";

apps/web/app/api/auth/[...nextauth].notused/route.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/web/components/public/session-button.tsx

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/web/jest.client.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const config = {
3333
"^react$": "<rootDir>/node_modules/react",
3434
"^react-dom$": "<rootDir>/node_modules/react-dom",
3535
"^react/jsx-runtime$": "<rootDir>/node_modules/react/jsx-runtime.js",
36-
// "next-auth": "<rootDir>/__mocks__/next-auth.ts",
3736
"@courselit/utils": "<rootDir>/../../packages/utils/src",
3837
"@courselit/common-logic": "<rootDir>/../../packages/common-logic/src",
3938
"@courselit/page-primitives":

apps/web/jest.server.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const config: Config = {
55
setupFilesAfterEnv: ["<rootDir>/setupTests.server.ts"],
66
watchPathIgnorePatterns: ["globalConfig"],
77
moduleNameMapper: {
8-
// "next-auth": "<rootDir>/__mocks__/next-auth.ts",
98
"@courselit/utils": "<rootDir>/../../packages/utils/src",
109
"@courselit/common-logic": "<rootDir>/../../packages/common-logic/src",
1110
"@courselit/page-primitives":

apps/web/lib/utils.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { UIConstants } from "@courselit/common-models";
2-
import { createHash, randomInt } from "crypto";
2+
import { randomInt } from "crypto";
33

44
export const capitalize = (s: string) => {
55
if (typeof s !== "string") return "";
@@ -66,10 +66,3 @@ export const hasPermissionToAccessSetupChecklist = (
6666
export function generateUniquePasscode() {
6767
return randomInt(100000, 999999);
6868
}
69-
70-
// Inspired from: https://github.com/nextauthjs/next-auth/blob/c4ad77b86762b7fd2e6362d8bf26c5953846774a/packages/next-auth/src/core/lib/utils.ts#L16
71-
export function hashCode(code: number) {
72-
return createHash("sha256")
73-
.update(`${code}${process.env.AUTH_SECRET}`)
74-
.digest("hex");
75-
}

apps/web/proxy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,4 @@ export const config = {
9393
"/healthy",
9494
"/dashboard/:path*",
9595
],
96-
unstable_allowDynamic: ["/node_modules/next-auth/**"],
9796
};

pnpm-lock.yaml

Lines changed: 6 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)