FIX OF ALL ISSUES WITH LOG IN PAGE. EVERYTHING TO THE POINT OF TESTING THE MAP WORKS SO FAR.

This commit is contained in:
bobbert committed 2025-03-15 00:22:47 +00:00
1 parent 84f010cb87
commit c79a9636a7
10 files changed
+228 -233

No files matched your search

+11 -1
View File
@@ -6,7 +6,10 @@ export async function POST(request) {
try {
// Use our custom token verification instead of getServerSession
const cookieStore = await cookies();
const sessionToken = cookieStore.get("next-auth.session-token")?.value;
// Check for both possible cookie names
const sessionToken =
cookieStore.get("next-auth.session-token")?.value ||
cookieStore.get("__Secure-next-auth.session-token")?.value;
if (!sessionToken) {
return Response.json({ error: "Unauthorized" }, { status: 401 });
@@ -42,6 +45,13 @@ export async function POST(request) {
userData.id,
]);
// Update the user's token with the new team information
const updatedUserData = {
...userData,
teamId: teamResult.lastID,
iat: Math.floor(Date.now() / 1000),
};
// Return success with the team ID for redirection
return Response.json(
{