diff --git a/pages/account/no-profile.js b/pages/account/no-profile.js index 0e514a4b740..62c9cff62f4 100644 --- a/pages/account/no-profile.js +++ b/pages/account/no-profile.js @@ -1,10 +1,10 @@ import { authOptions } from "../api/auth/[...nextauth]"; -import { unstable_getServerSession } from "next-auth/next"; +import { getServerSession } from "next-auth/next"; import Page from "@components/Page"; import PageHead from "@components/PageHead"; export async function getServerSideProps(context) { - const session = await unstable_getServerSession( + const session = await getServerSession( context.req, context.res, authOptions diff --git a/pages/account/statistics.js b/pages/account/statistics.js index 4afaa378c3f..799c542eb0a 100644 --- a/pages/account/statistics.js +++ b/pages/account/statistics.js @@ -1,5 +1,5 @@ import { authOptions } from "../api/auth/[...nextauth]"; -import { unstable_getServerSession } from "next-auth/next"; +import { getServerSession } from "next-auth/next"; import ProgressBar from "@components/statistics/ProgressBar"; import { @@ -22,7 +22,7 @@ import BasicCards from "@components/statistics/BasicCards"; export async function getServerSideProps(context) { const { req, res } = context; - const session = await unstable_getServerSession(req, res, authOptions); + const session = await getServerSession(req, res, authOptions); if (!session) { return { diff --git a/pages/api/account/statistics.js b/pages/api/account/statistics.js index ffb8aa4fb6d..9a500ee94fb 100644 --- a/pages/api/account/statistics.js +++ b/pages/api/account/statistics.js @@ -1,5 +1,5 @@ import { authOptions } from "../auth/[...nextauth]"; -import { unstable_getServerSession } from "next-auth/next"; +import { getServerSession } from "next-auth/next"; import connectMongo from "@config/mongo"; import logger from "@config/logger"; @@ -9,7 +9,7 @@ import Link from "@models/Link"; import LinkStats from "@models/LinkStats"; export default async function handler(req, res) { - const session = await unstable_getServerSession(req, res, authOptions); + const session = await getServerSession(req, res, authOptions); if (!session) { res.status(401).json({ message: "You must be logged in." }); diff --git a/pages/api/users/[username]/index.js b/pages/api/users/[username]/index.js index 0743980e894..4acd136a91e 100644 --- a/pages/api/users/[username]/index.js +++ b/pages/api/users/[username]/index.js @@ -1,5 +1,5 @@ import { authOptions } from "../../auth/[...nextauth]"; -import { unstable_getServerSession } from "next-auth/next"; +import { getServerSession } from "next-auth/next"; import connectMongo from "@config/mongo"; import logger from "@config/logger"; @@ -25,7 +25,7 @@ export default async function handler(req, res) { export async function getUserApi(req, res, username) { await connectMongo(); let isOwner = false; - const session = await unstable_getServerSession(req, res, authOptions); + const session = await getServerSession(req, res, authOptions); if (session && session.username === username) { isOwner = true; }