add type-safe getSession() (#486)
* fix types for auth * implement safer to use `getSession`
This commit is contained in:
1 parent
a162949cf1
commit
a0a0ec86f0
13 files changed
+130
-92
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import type {NextApiRequest, NextApiResponse} from 'next';
|
||||
import {getSession} from 'next-auth/client';
|
||||
import prisma from '../../../lib/prisma';
|
||||
import {IntegrationCalendar, listCalendars} from "../../../lib/calendarClient";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { getSession } from "@lib/auth";
|
||||
import prisma from "../../../lib/prisma";
|
||||
import { IntegrationCalendar, listCalendars } from "../../../lib/calendarClient";
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const session = await getSession({req: req});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type {NextApiRequest, NextApiResponse} from 'next';
|
||||
import {getSession} from 'next-auth/client';
|
||||
import prisma from '../../../lib/prisma';
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { getSession } from "@lib/auth";
|
||||
import prisma from "../../../lib/prisma";
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const session = await getSession({req: req});
|
||||
|
||||
Reference in new issue
Block a user