fixed dispatch eslint errors

This commit is contained in:
PxlLoewe
2025-07-10 00:35:34 -07:00
parent eec72a51b8
commit a9a4f1617a
47 changed files with 396 additions and 185 deletions

View File

@@ -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,