pnpm build
This commit is contained in:
@@ -1,24 +1,5 @@
|
||||
import NextAuth, { NextAuthOptions } from 'next-auth';
|
||||
import DiscordProvider from 'next-auth/providers/discord';
|
||||
|
||||
export const authOptions: NextAuthOptions = {
|
||||
providers: [
|
||||
DiscordProvider({
|
||||
clientId: process.env.DISCORD_CLIENT_ID!,
|
||||
clientSecret: process.env.DISCORD_CLIENT_SECRET!,
|
||||
}),
|
||||
],
|
||||
callbacks: {
|
||||
async session({ session, token }) {
|
||||
if (session.user && token.sub) {
|
||||
session.user.id = token.sub;
|
||||
} else {
|
||||
session.user.id = '';
|
||||
}
|
||||
return session;
|
||||
},
|
||||
}
|
||||
};
|
||||
import { authOptions } from "@/lib/auth";
|
||||
import NextAuth from "next-auth";
|
||||
|
||||
const handler = NextAuth(authOptions);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
import bcrypt from 'bcryptjs';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { authOptions } from '../auth/[...nextauth]/route';
|
||||
|
||||
import { customAlphabet } from 'nanoid';
|
||||
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz0123456789', 7);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { getDashboardStats } from '@/lib/stats';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { authOptions } from '../auth/[...nextauth]/route';
|
||||
|
||||
export async function GET() {
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { NextResponse } from "next/server";
|
||||
import { NextResponse, type NextRequest } from "next/server";
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: { id: string } }
|
||||
_req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
const { id } = params;
|
||||
const { id } = await params;
|
||||
|
||||
if (!id) {
|
||||
return new NextResponse("Invalid ID", { status: 400 });
|
||||
@@ -22,4 +22,4 @@ export async function GET(
|
||||
"Cache-Control": "no-store",
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user