feat: scaffold monorepo

This commit is contained in:
Yangshun Tay
2022-09-29 16:23:34 +08:00
parent 27a82e8c0f
commit 523d91f920
62 changed files with 19346 additions and 712 deletions

View File

@@ -0,0 +1,15 @@
// Wrapper for unstable_getServerSession https://next-auth.js.org/configuration/nextjs
import type { GetServerSidePropsContext } from 'next';
// eslint-disable-next-line camelcase
import { unstable_getServerSession } from 'next-auth';
import { authOptions as nextAuthOptions } from '~/pages/api/auth/[...nextauth]';
// Next API route example - /pages/api/restricted.ts
export const getServerAuthSession = async (ctx: {
req: GetServerSidePropsContext['req'];
res: GetServerSidePropsContext['res'];
}) => {
return await unstable_getServerSession(ctx.req, ctx.res, nextAuthOptions);
};