Refactor database schema; add hunts and team_clues tables, update clues structure, and improve error handling in routes

This commit is contained in:
bobbert committed 2025-03-12 16:16:42 +00:00
1 parent 4f7fdc6ad2
commit 77e83dc21c
13 files changed
+136 -111

No files matched your search

+4 -5
View File
@@ -1,5 +1,7 @@
export const runtime = "nodejs";
// Fix: Make sure we're using the correct import
import NextAuth from "next-auth";
import CredentialsProvider from "next-auth/providers/credentials";
import { validateCredentials } from "@/actions/auth";
// Ensure NEXTAUTH_SECRET is defined
@@ -15,10 +17,9 @@ if (!process.env.NEXTAUTH_URL) {
export const authOptions = {
debug: process.env.NODE_ENV === "development",
providers: [
{
CredentialsProvider({
id: "credentials",
name: "Credentials",
type: "credentials",
credentials: {
username: { label: "Username", type: "text" },
password: { label: "Password", type: "password" },
@@ -43,7 +44,7 @@ export const authOptions = {
return null;
}
},
},
}),
],
callbacks: {
async jwt({ token, user }) {
@@ -66,11 +67,9 @@ export const authOptions = {
return session;
},
},
// no "pages" property
session: { strategy: "jwt", maxAge: 30 * 24 * 60 * 60 },
secret: process.env.NEXTAUTH_SECRET,
};
// Creating the handler after exporting authOptions
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };