fixed dispatch eslint errors
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { AuthOptions, getServerSession as getNextAuthServerSession } from "next-auth";
|
||||
import { PrismaAdapter } from "@next-auth/prisma-adapter";
|
||||
import Credentials from "next-auth/providers/credentials";
|
||||
import { prisma, PrismaClient } from "@repo/db";
|
||||
import { prisma } from "@repo/db";
|
||||
|
||||
export const options: AuthOptions = {
|
||||
providers: [
|
||||
@@ -9,7 +10,7 @@ export const options: AuthOptions = {
|
||||
credentials: {
|
||||
code: { label: "code", type: "code" },
|
||||
},
|
||||
async authorize(credentials, req) {
|
||||
async authorize(credentials) {
|
||||
try {
|
||||
if (!credentials) throw new Error("No credentials provided");
|
||||
const code = await prisma.oAuthToken.findFirstOrThrow({
|
||||
@@ -60,7 +61,7 @@ export const options: AuthOptions = {
|
||||
|
||||
adapter: PrismaAdapter(prisma as any),
|
||||
callbacks: {
|
||||
jwt: async ({ token, user, ...rest }) => {
|
||||
jwt: async ({ token, user }) => {
|
||||
if (user && "firstname" in user) {
|
||||
return {
|
||||
...token,
|
||||
@@ -69,7 +70,7 @@ export const options: AuthOptions = {
|
||||
}
|
||||
return token;
|
||||
},
|
||||
session: async ({ session, user, token }) => {
|
||||
session: async ({ session, token }) => {
|
||||
const dbUser = await prisma.user.findUnique({
|
||||
where: {
|
||||
id: token?.sub,
|
||||
|
||||
Reference in New Issue
Block a user