fix: cache is not exportet from react (#417)

* fix: cache is not exportet from react

* fix: format issue

* fix: type issue
This commit is contained in:
Meier Lukas
2024-05-01 21:17:28 +02:00
committed by GitHub
parent 48c2473ab3
commit fba767bde3
8 changed files with 17 additions and 12 deletions

View File

@@ -1,4 +1,3 @@
import { cache } from "react";
import type { DefaultSession } from "@auth/core/types";
import { createConfiguration } from "./configuration";
@@ -17,11 +16,5 @@ export * from "./security";
export const createHandlers = (isCredentialsRequest: boolean) =>
createConfiguration(isCredentialsRequest);
const { auth: defaultAuth } = createConfiguration(false);
/**
* This is the main way to get session data for your RSCs.
* This will de-duplicate all calls to next-auth's default `auth()` function and only call it once per request
*/
export const auth = cache(defaultAuth);
export { getSessionFromToken, sessionTokenCookieName } from "./session";