diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 72bd773..282f20a 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,4 +1,4 @@ -import { getSession } from "@/authOptions"; +import { getSession } from "next-auth/react"; import AppWrapper from "./components/AppWrapper"; import "./globals.css"; diff --git a/src/authOptions.ts b/src/authOptions.ts index 356aa6e..46ebe52 100644 --- a/src/authOptions.ts +++ b/src/authOptions.ts @@ -1,10 +1,9 @@ import axios from "axios"; import moment from "moment"; -import { AuthOptions, getServerSession, Session } from "next-auth"; +import { AuthOptions, Session } from "next-auth"; import { JWT } from "next-auth/jwt"; import jsonwebtoken from "jsonwebtoken"; import { JWTDecoded } from "./app/types/next-auth"; -import { cache } from "react"; moment.locale("fr"); @@ -19,7 +18,7 @@ export const authOptions: AuthOptions = { authorization: { url: process.env.OAUTH_AUTHORIZATION_URL, params: { - scope: "openid email profile", + scope: "openid email profile offline_access", response_type: "code", }, }, @@ -139,5 +138,3 @@ const refreshAccessToken = async (token: JWT): Promise => { return refreshPromise; }; - -export const getSession = cache(() => getServerSession());