diff --git a/app/agenda/page.tsx b/app/agenda/page.tsx index 04c2fc5b..622fc734 100644 --- a/app/agenda/page.tsx +++ b/app/agenda/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { prisma } from "@/lib/prisma"; import { CalendarClient } from "@/components/calendar/calendar-client"; diff --git a/app/agilite/page.tsx b/app/agilite/page.tsx index 7ddb4e8a..145f7cbc 100644 --- a/app/agilite/page.tsx +++ b/app/agilite/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/alma/page.tsx b/app/alma/page.tsx index 53b90397..47216139 100644 --- a/app/alma/page.tsx +++ b/app/alma/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/announcement/page.tsx b/app/announcement/page.tsx index 67d70e1c..2474065b 100644 --- a/app/announcement/page.tsx +++ b/app/announcement/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { AnnouncementsPage } from "@/components/announcement/announcements-page"; diff --git a/app/api/admin/restore-credentials/route.ts b/app/api/admin/restore-credentials/route.ts index d6784455..08e581d1 100644 --- a/app/api/admin/restore-credentials/route.ts +++ b/app/api/admin/restore-credentials/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; import { getRedisClient } from '@/lib/redis'; diff --git a/app/api/admin/view-redis-credentials/route.ts b/app/api/admin/view-redis-credentials/route.ts index 62b1654b..26da9ddd 100644 --- a/app/api/admin/view-redis-credentials/route.ts +++ b/app/api/admin/view-redis-credentials/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getRedisClient } from '@/lib/redis'; // This route just views Redis email credentials without making any changes diff --git a/app/api/announcements/[id]/route.ts b/app/api/announcements/[id]/route.ts index 4f4edcb6..386422cf 100644 --- a/app/api/announcements/[id]/route.ts +++ b/app/api/announcements/[id]/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; /** diff --git a/app/api/announcements/route.ts b/app/api/announcements/route.ts index 2c5ffbb7..42497630 100644 --- a/app/api/announcements/route.ts +++ b/app/api/announcements/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; /** diff --git a/app/api/calendar/route.ts b/app/api/calendar/route.ts index ca4df276..2d79d6e1 100644 --- a/app/api/calendar/route.ts +++ b/app/api/calendar/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { PrismaClient } from "@prisma/client"; const prisma = new PrismaClient(); diff --git a/app/api/calendars/[id]/events/[eventId]/route.ts b/app/api/calendars/[id]/events/[eventId]/route.ts index aac8d66e..5de50185 100644 --- a/app/api/calendars/[id]/events/[eventId]/route.ts +++ b/app/api/calendars/[id]/events/[eventId]/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; /** diff --git a/app/api/calendars/[id]/events/route.ts b/app/api/calendars/[id]/events/route.ts index b097a0a9..09275052 100644 --- a/app/api/calendars/[id]/events/route.ts +++ b/app/api/calendars/[id]/events/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; /** diff --git a/app/api/calendars/[id]/route.ts b/app/api/calendars/[id]/route.ts index c6ce4151..8bb5df73 100644 --- a/app/api/calendars/[id]/route.ts +++ b/app/api/calendars/[id]/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; /** diff --git a/app/api/calendars/[id]/share/route.ts b/app/api/calendars/[id]/share/route.ts index 6ebdd06b..a11c1c87 100644 --- a/app/api/calendars/[id]/share/route.ts +++ b/app/api/calendars/[id]/share/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; import crypto from "crypto"; diff --git a/app/api/calendars/default/route.ts b/app/api/calendars/default/route.ts index d4adc3b7..8b9c912f 100644 --- a/app/api/calendars/default/route.ts +++ b/app/api/calendars/default/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; /** diff --git a/app/api/calendars/route.ts b/app/api/calendars/route.ts index a7032ba7..ea6b8a7a 100644 --- a/app/api/calendars/route.ts +++ b/app/api/calendars/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; import { getCachedCalendarData, cacheCalendarData } from "@/lib/redis"; diff --git a/app/api/courrier/[id]/flag/route.ts b/app/api/courrier/[id]/flag/route.ts index 37f86714..3c84795e 100644 --- a/app/api/courrier/[id]/flag/route.ts +++ b/app/api/courrier/[id]/flag/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { toggleEmailFlag } from '@/lib/services/email-service'; import { invalidateEmailContentCache, invalidateFolderCache } from '@/lib/redis'; diff --git a/app/api/courrier/[id]/mark-read/route.ts b/app/api/courrier/[id]/mark-read/route.ts index c915e873..32e7d71e 100644 --- a/app/api/courrier/[id]/mark-read/route.ts +++ b/app/api/courrier/[id]/mark-read/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { markEmailReadStatus } from '@/lib/services/email-service'; import { invalidateEmailContentCache, invalidateFolderCache } from '@/lib/redis'; diff --git a/app/api/courrier/[id]/route.ts b/app/api/courrier/[id]/route.ts index fd1321ff..b596173c 100644 --- a/app/api/courrier/[id]/route.ts +++ b/app/api/courrier/[id]/route.ts @@ -8,7 +8,7 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getEmailContent, markEmailReadStatus } from '@/lib/services/email-service'; import { getCachedEmailContent, invalidateEmailContentCache } from '@/lib/redis'; diff --git a/app/api/courrier/account-details/route.ts b/app/api/courrier/account-details/route.ts index 52e2055a..b0af80b6 100644 --- a/app/api/courrier/account-details/route.ts +++ b/app/api/courrier/account-details/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; export async function GET(request: Request) { diff --git a/app/api/courrier/account-folders/route.ts b/app/api/courrier/account-folders/route.ts index efbc8695..6f5d6dc3 100644 --- a/app/api/courrier/account-folders/route.ts +++ b/app/api/courrier/account-folders/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getMailboxes } from '@/lib/services/email-service'; import { ImapFlow } from 'imapflow'; import { prisma } from '@/lib/prisma'; diff --git a/app/api/courrier/account-list/route.ts b/app/api/courrier/account-list/route.ts index 7a141eb9..9f9486b9 100644 --- a/app/api/courrier/account-list/route.ts +++ b/app/api/courrier/account-list/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; export async function GET(request: Request) { diff --git a/app/api/courrier/account/route.ts b/app/api/courrier/account/route.ts index 1f7d508f..994eb09d 100644 --- a/app/api/courrier/account/route.ts +++ b/app/api/courrier/account/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { saveUserEmailCredentials, testEmailConnection } from '@/lib/services/email-service'; import { invalidateFolderCache } from '@/lib/redis'; import { prisma } from '@/lib/prisma'; diff --git a/app/api/courrier/credentials/route.ts b/app/api/courrier/credentials/route.ts index 789f9b08..ff34b8dc 100644 --- a/app/api/courrier/credentials/route.ts +++ b/app/api/courrier/credentials/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getUserEmailCredentials } from '@/lib/services/email-service'; export async function GET() { diff --git a/app/api/courrier/debug-account/route.ts b/app/api/courrier/debug-account/route.ts index 2826444f..fc48fd43 100644 --- a/app/api/courrier/debug-account/route.ts +++ b/app/api/courrier/debug-account/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getCachedEmailCredentials, getCachedImapSession } from '@/lib/redis'; import { prisma } from '@/lib/prisma'; import { getMailboxes } from '@/lib/services/email-service'; diff --git a/app/api/courrier/delete/route.ts b/app/api/courrier/delete/route.ts index 34b018cb..e26aa5e0 100644 --- a/app/api/courrier/delete/route.ts +++ b/app/api/courrier/delete/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getImapConnection } from '@/lib/services/email-service'; import { invalidateFolderCache } from '@/lib/redis'; diff --git a/app/api/courrier/emails/route.ts b/app/api/courrier/emails/route.ts index 6de19871..92fd5bfe 100644 --- a/app/api/courrier/emails/route.ts +++ b/app/api/courrier/emails/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getEmails } from '@/lib/services/email-service'; import { getCachedEmailList, diff --git a/app/api/courrier/fix-folders/route.ts b/app/api/courrier/fix-folders/route.ts index 915e0b56..36df2f23 100644 --- a/app/api/courrier/fix-folders/route.ts +++ b/app/api/courrier/fix-folders/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; import { getMailboxes } from '@/lib/services/email-service'; import { ImapFlow } from 'imapflow'; diff --git a/app/api/courrier/microsoft/callback/route.ts b/app/api/courrier/microsoft/callback/route.ts index 4f9533c5..f1f53271 100644 --- a/app/api/courrier/microsoft/callback/route.ts +++ b/app/api/courrier/microsoft/callback/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { exchangeCodeForTokens } from '@/lib/services/microsoft-oauth'; import { prisma } from '@/lib/prisma'; import { testEmailConnection, saveUserEmailCredentials } from '@/lib/services/email-service'; diff --git a/app/api/courrier/microsoft/route.ts b/app/api/courrier/microsoft/route.ts index 0caebc6c..8537e88e 100644 --- a/app/api/courrier/microsoft/route.ts +++ b/app/api/courrier/microsoft/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getMicrosoftAuthUrl } from '@/lib/services/microsoft-oauth'; // Endpoint to initiate Microsoft OAuth flow diff --git a/app/api/courrier/recache/route.ts b/app/api/courrier/recache/route.ts index 89e36f67..6635086e 100644 --- a/app/api/courrier/recache/route.ts +++ b/app/api/courrier/recache/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from 'next/server'; import { getServerSession } from 'next-auth/next'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { forceRecacheUserCredentials } from '@/lib/services/email-service'; export async function GET(request: NextRequest) { diff --git a/app/api/courrier/refresh/route.ts b/app/api/courrier/refresh/route.ts index 1a209450..bb4e55c7 100644 --- a/app/api/courrier/refresh/route.ts +++ b/app/api/courrier/refresh/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getEmails } from '@/lib/services/email-service'; import { invalidateFolderCache } from '@/lib/redis'; import { refreshEmailsInBackground } from '@/lib/services/prefetch-service'; diff --git a/app/api/courrier/route.ts b/app/api/courrier/route.ts index 342fb7c2..729635da 100644 --- a/app/api/courrier/route.ts +++ b/app/api/courrier/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getEmails } from '@/lib/services/email-service'; import { getCachedEmailList, diff --git a/app/api/courrier/send/route.ts b/app/api/courrier/send/route.ts index a88f44d0..32b13b7e 100644 --- a/app/api/courrier/send/route.ts +++ b/app/api/courrier/send/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { sendEmail } from '@/lib/services/email-service'; export async function POST(request: Request) { diff --git a/app/api/courrier/session/route.ts b/app/api/courrier/session/route.ts index 2b75d11d..9485eec9 100644 --- a/app/api/courrier/session/route.ts +++ b/app/api/courrier/session/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getMailboxes } from '@/lib/services/email-service'; import { getRedisClient } from '@/lib/redis'; import { getImapConnection } from '@/lib/services/email-service'; diff --git a/app/api/courrier/unread-counts/route.ts b/app/api/courrier/unread-counts/route.ts index 98b14927..424858ad 100644 --- a/app/api/courrier/unread-counts/route.ts +++ b/app/api/courrier/unread-counts/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getImapConnection } from '@/lib/services/email-service'; import { prisma } from '@/lib/prisma'; import { getRedisClient } from '@/lib/redis'; diff --git a/app/api/debug-email/route.ts b/app/api/debug-email/route.ts index a6dc91bf..6d4b8671 100644 --- a/app/api/debug-email/route.ts +++ b/app/api/debug-email/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getImapConnection } from '@/lib/services/email-service'; import { simpleParser } from 'mailparser'; diff --git a/app/api/debug/create-all-folders/route.ts b/app/api/debug/create-all-folders/route.ts index 56ce2600..640b557e 100644 --- a/app/api/debug/create-all-folders/route.ts +++ b/app/api/debug/create-all-folders/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { createUserFolderStructure } from '@/lib/s3'; export async function GET(request: Request) { diff --git a/app/api/debug/leantime-methods/route.ts b/app/api/debug/leantime-methods/route.ts index 48883588..99f82570 100644 --- a/app/api/debug/leantime-methods/route.ts +++ b/app/api/debug/leantime-methods/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; // GET /api/debug/leantime-methods export async function GET(request: Request) { diff --git a/app/api/debug/notifications/route.ts b/app/api/debug/notifications/route.ts index 9ce804d9..dbc6a614 100644 --- a/app/api/debug/notifications/route.ts +++ b/app/api/debug/notifications/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { NotificationService } from '@/lib/services/notifications/notification-service'; // GET /api/debug/notifications diff --git a/app/api/debug/s3/route.ts b/app/api/debug/s3/route.ts index 6c1a08ce..c68315f4 100644 --- a/app/api/debug/s3/route.ts +++ b/app/api/debug/s3/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { ListBucketsCommand, ListObjectsV2Command } from '@aws-sdk/client-s3'; import { s3Client, S3_CONFIG } from '@/lib/s3'; diff --git a/app/api/emails/route.ts b/app/api/emails/route.ts index 8f3a3960..ad656731 100644 --- a/app/api/emails/route.ts +++ b/app/api/emails/route.ts @@ -1,6 +1,6 @@ import { NextResponse, NextRequest } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; export async function GET(req: NextRequest) { try { diff --git a/app/api/events/[id]/route.ts b/app/api/events/[id]/route.ts index 7848e0e1..d4a02390 100644 --- a/app/api/events/[id]/route.ts +++ b/app/api/events/[id]/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; export async function DELETE(req: NextRequest, props: { params: Promise<{ id: string }> }) { diff --git a/app/api/events/route.ts b/app/api/events/route.ts index 550bfe1b..318babd2 100644 --- a/app/api/events/route.ts +++ b/app/api/events/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from "@/lib/prisma"; export async function POST(req: NextRequest) { diff --git a/app/api/groups/[groupId]/members/route.ts b/app/api/groups/[groupId]/members/route.ts index fefc8539..0126dd74 100644 --- a/app/api/groups/[groupId]/members/route.ts +++ b/app/api/groups/[groupId]/members/route.ts @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { NextResponse } from "next/server"; export async function GET(req: Request, props: { params: Promise<{ groupId: string }> }) { diff --git a/app/api/groups/[groupId]/route.ts b/app/api/groups/[groupId]/route.ts index 2d99661c..954d64bc 100644 --- a/app/api/groups/[groupId]/route.ts +++ b/app/api/groups/[groupId]/route.ts @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "../../auth/[...nextauth]/route"; +import { authOptions } from "../../auth/options"; import { NextResponse } from "next/server"; async function getAdminToken() { diff --git a/app/api/groups/route.ts b/app/api/groups/route.ts index 062e1ec8..af307ad9 100644 --- a/app/api/groups/route.ts +++ b/app/api/groups/route.ts @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { NextResponse } from "next/server"; async function getAdminToken() { diff --git a/app/api/leantime/status-labels/route.ts b/app/api/leantime/status-labels/route.ts index 6e1fb888..5493dad1 100644 --- a/app/api/leantime/status-labels/route.ts +++ b/app/api/leantime/status-labels/route.ts @@ -1,6 +1,6 @@ import { NextRequest } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { NextResponse } from "next/server"; interface StatusLabel { diff --git a/app/api/leantime/tasks/route.ts b/app/api/leantime/tasks/route.ts index 03b49cab..1257322c 100644 --- a/app/api/leantime/tasks/route.ts +++ b/app/api/leantime/tasks/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { getCachedTasksData, cacheTasksData } from "@/lib/redis"; interface Task { diff --git a/app/api/missions/[missionId]/attachments/[attachmentId]/route.ts b/app/api/missions/[missionId]/attachments/[attachmentId]/route.ts index a5e8fd2a..45bb3750 100644 --- a/app/api/missions/[missionId]/attachments/[attachmentId]/route.ts +++ b/app/api/missions/[missionId]/attachments/[attachmentId]/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; import { deleteMissionAttachment } from '@/lib/mission-uploads'; diff --git a/app/api/missions/[missionId]/attachments/download/[attachmentId]/route.ts b/app/api/missions/[missionId]/attachments/download/[attachmentId]/route.ts index 2ec6ad96..55732a85 100644 --- a/app/api/missions/[missionId]/attachments/download/[attachmentId]/route.ts +++ b/app/api/missions/[missionId]/attachments/download/[attachmentId]/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; import { getSignedUrl } from '@aws-sdk/s3-request-presigner'; import { GetObjectCommand } from '@aws-sdk/client-s3'; diff --git a/app/api/missions/[missionId]/attachments/route.ts b/app/api/missions/[missionId]/attachments/route.ts index 0289264b..38cd65a8 100644 --- a/app/api/missions/[missionId]/attachments/route.ts +++ b/app/api/missions/[missionId]/attachments/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; // Helper function to check authentication diff --git a/app/api/missions/[missionId]/route.ts b/app/api/missions/[missionId]/route.ts index f320beb7..b0776f44 100644 --- a/app/api/missions/[missionId]/route.ts +++ b/app/api/missions/[missionId]/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; import { deleteMissionLogo } from '@/lib/mission-uploads'; diff --git a/app/api/missions/route.ts b/app/api/missions/route.ts index 544e2e46..0aff6f5e 100644 --- a/app/api/missions/route.ts +++ b/app/api/missions/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; // Helper function to check authentication diff --git a/app/api/missions/upload/route.ts b/app/api/missions/upload/route.ts index f7823b55..e6d080e0 100644 --- a/app/api/missions/upload/route.ts +++ b/app/api/missions/upload/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { PrismaClient } from '@prisma/client'; import { prisma } from '@/lib/prisma'; import { diff --git a/app/api/nextcloud/files/content/route.ts b/app/api/nextcloud/files/content/route.ts index bd573acb..4c263a05 100644 --- a/app/api/nextcloud/files/content/route.ts +++ b/app/api/nextcloud/files/content/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; // This file serves as an adapter to redirect requests from the old NextCloud // content endpoint to the new MinIO S3 content endpoint diff --git a/app/api/nextcloud/files/route.ts b/app/api/nextcloud/files/route.ts index 124d8da8..52f8e092 100644 --- a/app/api/nextcloud/files/route.ts +++ b/app/api/nextcloud/files/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; // This file serves as an adapter to redirect requests from the old NextCloud // endpoints to the new MinIO S3 endpoints diff --git a/app/api/nextcloud/init/route.ts b/app/api/nextcloud/init/route.ts index ee647a85..24ab5727 100644 --- a/app/api/nextcloud/init/route.ts +++ b/app/api/nextcloud/init/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; // This file serves as an adapter to redirect requests from the old NextCloud // init endpoint to the new MinIO S3 init endpoint diff --git a/app/api/nextcloud/status/route.ts b/app/api/nextcloud/status/route.ts index 041b663e..26511313 100644 --- a/app/api/nextcloud/status/route.ts +++ b/app/api/nextcloud/status/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; // This file serves as an adapter to redirect requests from the old NextCloud // status endpoint to the new MinIO S3 status endpoint diff --git a/app/api/notifications/[id]/read/route.ts b/app/api/notifications/[id]/read/route.ts index 66b7dec0..fc498b38 100644 --- a/app/api/notifications/[id]/read/route.ts +++ b/app/api/notifications/[id]/read/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { NotificationService } from '@/lib/services/notifications/notification-service'; // POST /api/notifications/{id}/read diff --git a/app/api/notifications/count/route.ts b/app/api/notifications/count/route.ts index bd13e57a..79512b63 100644 --- a/app/api/notifications/count/route.ts +++ b/app/api/notifications/count/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { NotificationService } from '@/lib/services/notifications/notification-service'; // GET /api/notifications/count diff --git a/app/api/notifications/read-all/route.ts b/app/api/notifications/read-all/route.ts index bcee46cf..70d0f30f 100644 --- a/app/api/notifications/read-all/route.ts +++ b/app/api/notifications/read-all/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { NotificationService } from '@/lib/services/notifications/notification-service'; // POST /api/notifications/read-all diff --git a/app/api/notifications/route.ts b/app/api/notifications/route.ts index b0f127bb..447f7e00 100644 --- a/app/api/notifications/route.ts +++ b/app/api/notifications/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { NotificationService } from '@/lib/services/notifications/notification-service'; // GET /api/notifications?page=1&limit=20 diff --git a/app/api/rocket-chat/messages/route.ts b/app/api/rocket-chat/messages/route.ts index bf00a5c6..e90477b3 100644 --- a/app/api/rocket-chat/messages/route.ts +++ b/app/api/rocket-chat/messages/route.ts @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { NextResponse } from "next/server"; import { getCachedMessagesData, cacheMessagesData } from "@/lib/redis"; diff --git a/app/api/roles/route.ts b/app/api/roles/route.ts index 725d8cdc..a7cfeffb 100644 --- a/app/api/roles/route.ts +++ b/app/api/roles/route.ts @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { NextResponse } from "next/server"; async function getAdminToken() { diff --git a/app/api/storage/files/content/route.ts b/app/api/storage/files/content/route.ts index 7d037897..2affc9c5 100644 --- a/app/api/storage/files/content/route.ts +++ b/app/api/storage/files/content/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { getObjectContent } from '@/lib/s3'; // Helper function to check authentication diff --git a/app/api/storage/files/route.ts b/app/api/storage/files/route.ts index 45b0f0db..8d4ae24e 100644 --- a/app/api/storage/files/route.ts +++ b/app/api/storage/files/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { listUserObjects, putObject, deleteObject } from '@/lib/s3'; // Helper function to check authentication diff --git a/app/api/storage/init/folder/route.ts b/app/api/storage/init/folder/route.ts index d7840766..93e91a7d 100644 --- a/app/api/storage/init/folder/route.ts +++ b/app/api/storage/init/folder/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { putObject } from '@/lib/s3'; import { S3_CONFIG } from '@/lib/s3'; diff --git a/app/api/storage/init/route.ts b/app/api/storage/init/route.ts index ead1b143..e74a225d 100644 --- a/app/api/storage/init/route.ts +++ b/app/api/storage/init/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { createUserFolderStructure } from '@/lib/s3'; export async function POST(request: Request) { diff --git a/app/api/storage/status/route.ts b/app/api/storage/status/route.ts index 05099bf9..0a5df638 100644 --- a/app/api/storage/status/route.ts +++ b/app/api/storage/status/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { ListBucketsCommand, ListObjectsV2Command } from '@aws-sdk/client-s3'; import { createUserFolderStructure } from '@/lib/s3'; diff --git a/app/api/users/[userId]/password/route.ts b/app/api/users/[userId]/password/route.ts index e68ea731..4b5bea9f 100644 --- a/app/api/users/[userId]/password/route.ts +++ b/app/api/users/[userId]/password/route.ts @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { NextResponse } from "next/server"; export async function PUT(req: Request, props: { params: Promise<{ userId: string }> }) { diff --git a/app/api/users/[userId]/roles/route.ts b/app/api/users/[userId]/roles/route.ts index ea86e55e..540df847 100644 --- a/app/api/users/[userId]/roles/route.ts +++ b/app/api/users/[userId]/roles/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from "next/server"; import { getServerSession } from "next-auth"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { getKeycloakAdminClient } from "@/lib/keycloak"; // Fix for Next.js "params should be awaited" error diff --git a/app/api/users/[userId]/route.ts b/app/api/users/[userId]/route.ts index bd342215..d316f034 100644 --- a/app/api/users/[userId]/route.ts +++ b/app/api/users/[userId]/route.ts @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { NextResponse } from "next/server"; // Helper function to get Leantime user ID by email diff --git a/app/api/users/route.ts b/app/api/users/route.ts index cbca0e0a..e2146300 100644 --- a/app/api/users/route.ts +++ b/app/api/users/route.ts @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { NextResponse } from "next/server"; import { createDolibarrUser, checkDolibarrUserExists, deleteDolibarrUser } from "@/lib/dolibarr-api"; diff --git a/app/apprendre/page.tsx b/app/apprendre/page.tsx index 0af118ab..28799bc9 100644 --- a/app/apprendre/page.tsx +++ b/app/apprendre/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/artlab/page.tsx b/app/artlab/page.tsx index f166f60e..468e4e90 100644 --- a/app/artlab/page.tsx +++ b/app/artlab/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/calcul/page.tsx b/app/calcul/page.tsx index e865d3d4..2f60a105 100644 --- a/app/calcul/page.tsx +++ b/app/calcul/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/chapitre/page.tsx b/app/chapitre/page.tsx index 0b4a7fb5..fdf79b06 100644 --- a/app/chapitre/page.tsx +++ b/app/chapitre/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/courrier/[id]/route.ts b/app/courrier/[id]/route.ts index ff9443b2..65254cb4 100644 --- a/app/courrier/[id]/route.ts +++ b/app/courrier/[id]/route.ts @@ -1,7 +1,7 @@ import { NextResponse } from 'next/server'; import { ImapFlow } from 'imapflow'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; import { simpleParser } from 'mailparser'; diff --git a/app/crm/page.tsx b/app/crm/page.tsx index f897b22d..0b3bf7d1 100644 --- a/app/crm/page.tsx +++ b/app/crm/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/dossiers/page.tsx b/app/dossiers/page.tsx index 8610b3ac..7e755bb3 100644 --- a/app/dossiers/page.tsx +++ b/app/dossiers/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/equipes/page.tsx b/app/equipes/page.tsx index e7e43de0..08f98380 100644 --- a/app/equipes/page.tsx +++ b/app/equipes/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ManagementTabs } from "@/components/management/management-tabs"; diff --git a/app/gite/page.tsx b/app/gite/page.tsx index e848c435..4db892a7 100644 --- a/app/gite/page.tsx +++ b/app/gite/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/groups/page.tsx b/app/groups/page.tsx index a8a4fa71..91671753 100644 --- a/app/groups/page.tsx +++ b/app/groups/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { GroupsTable } from "@/components/groups/groups-table"; diff --git a/app/layout.tsx b/app/layout.tsx index c726c206..b759b851 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,7 +3,7 @@ import { Inter } from "next/font/google"; import "./globals.css"; import { headers } from "next/headers"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { Providers } from "@/components/providers"; import { LayoutWrapper } from "@/components/layout/layout-wrapper"; import { warmupRedisCache } from '@/lib/redis'; diff --git a/app/livres/page.tsx b/app/livres/page.tsx index ab35de5e..12cc4f58 100644 --- a/app/livres/page.tsx +++ b/app/livres/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/mediation/page.tsx b/app/mediation/page.tsx index d0a6f7a7..571290f5 100644 --- a/app/mediation/page.tsx +++ b/app/mediation/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; export default async function Page() { diff --git a/app/observatory/page.tsx b/app/observatory/page.tsx index a491c6df..cad18405 100644 --- a/app/observatory/page.tsx +++ b/app/observatory/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ObservatoryView } from "@/components/observatory/observatory-view"; diff --git a/app/parole/page.tsx b/app/parole/page.tsx index e423fd1f..8f75337c 100644 --- a/app/parole/page.tsx +++ b/app/parole/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/press/page.tsx b/app/press/page.tsx index 1ff85fb1..8dcfc9d3 100644 --- a/app/press/page.tsx +++ b/app/press/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/radio/page.tsx b/app/radio/page.tsx index 782db942..480200a4 100644 --- a/app/radio/page.tsx +++ b/app/radio/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/showcase/page.tsx b/app/showcase/page.tsx index 3074d876..47531dd8 100644 --- a/app/showcase/page.tsx +++ b/app/showcase/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/the-message/page.tsx b/app/the-message/page.tsx index daa667c5..a4aa09e2 100644 --- a/app/the-message/page.tsx +++ b/app/the-message/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/timetracker/page.tsx b/app/timetracker/page.tsx index 21e9c9d4..53bfc893 100644 --- a/app/timetracker/page.tsx +++ b/app/timetracker/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { TimeTrackerFrame } from "@/components/timetracker/timetracker-frame"; diff --git a/app/users/page.tsx b/app/users/page.tsx index 69e3a27e..5051844f 100644 --- a/app/users/page.tsx +++ b/app/users/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { UsersTable } from "@/components/users/users-table"; diff --git a/app/vision/page.tsx b/app/vision/page.tsx index beed9827..eed05a58 100644 --- a/app/vision/page.tsx +++ b/app/vision/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/app/wp-admin/page.tsx b/app/wp-admin/page.tsx index 92c628c6..b65ab31a 100644 --- a/app/wp-admin/page.tsx +++ b/app/wp-admin/page.tsx @@ -1,5 +1,5 @@ import { getServerSession } from "next-auth/next"; -import { authOptions } from "@/app/api/auth/[...nextauth]/route"; +import { authOptions } from "@/app/api/auth/options"; import { redirect } from "next/navigation"; import { ResponsiveIframe } from "@/app/components/responsive-iframe"; diff --git a/lib/imap.ts b/lib/imap.ts index d29cce65..0c7c57f0 100644 --- a/lib/imap.ts +++ b/lib/imap.ts @@ -1,6 +1,6 @@ import { ImapFlow } from 'imapflow'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; import { prisma } from '@/lib/prisma'; import { getCachedEmailCredentials } from '@/lib/redis'; diff --git a/lib/services/notifications/leantime-adapter.ts b/lib/services/notifications/leantime-adapter.ts index adb52020..3255eaca 100644 --- a/lib/services/notifications/leantime-adapter.ts +++ b/lib/services/notifications/leantime-adapter.ts @@ -1,7 +1,7 @@ import { Notification, NotificationCount } from '@/lib/types/notification'; import { NotificationAdapter } from './notification-adapter.interface'; import { getServerSession } from 'next-auth'; -import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { authOptions } from "@/app/api/auth/options"; // Leantime notification type from their API interface LeantimeNotification { diff --git a/update-imports.js b/update-imports.js new file mode 100644 index 00000000..d2f54649 --- /dev/null +++ b/update-imports.js @@ -0,0 +1,102 @@ +const fs = require('fs'); +const path = require('path'); + +// Function to recursively find all TypeScript files +function findTsFiles(dir, fileList = []) { + const files = fs.readdirSync(dir); + + files.forEach(file => { + const filePath = path.join(dir, file); + const stat = fs.statSync(filePath); + + if (stat.isDirectory() && !filePath.includes('node_modules') && !filePath.includes('.next')) { + fileList = findTsFiles(filePath, fileList); + } else if ( + stat.isFile() && + (filePath.endsWith('.ts') || filePath.endsWith('.tsx')) && + !filePath.includes('node_modules') && + !filePath.includes('.next') + ) { + fileList.push(filePath); + } + }); + + return fileList; +} + +// Function to update import statements in a file +function updateImportInFile(filePath) { + try { + let content = fs.readFileSync(filePath, 'utf8'); + let updated = false; + + // Update absolute imports + if (content.includes('import { authOptions } from "@/app/api/auth/[...nextauth]/route"')) { + content = content.replace( + 'import { authOptions } from "@/app/api/auth/[...nextauth]/route"', + 'import { authOptions } from "@/app/api/auth/options"' + ); + updated = true; + } + + // Update relative imports + if (content.includes('import { authOptions } from "../../auth/[...nextauth]/route"')) { + content = content.replace( + 'import { authOptions } from "../../auth/[...nextauth]/route"', + 'import { authOptions } from "../../auth/options"' + ); + updated = true; + } + + // Other possible relative paths + const patterns = [ + /import\s*{\s*authOptions\s*}\s*from\s*['"](.*)\/auth\/\[\.\.\.\S+\]\/route['"]/g, + /import\s*{\s*authOptions\s*}\s*from\s*['"](.*)\[...\S+\]\/route['"]/g + ]; + + for (const pattern of patterns) { + const matches = content.matchAll(pattern); + for (const match of matches) { + const fullMatch = match[0]; + const basePath = match[1]; + const replacement = `import { authOptions } from "${basePath}/auth/options"`; + content = content.replace(fullMatch, replacement); + updated = true; + } + } + + if (updated) { + fs.writeFileSync(filePath, content, 'utf8'); + console.log(`Updated: ${filePath}`); + return true; + } + + return false; + } catch (error) { + console.error(`Error updating ${filePath}:`, error); + return false; + } +} + +// Main function +function main() { + const rootDir = './app'; + const libDir = './lib'; + + const tsFiles = [ + ...findTsFiles(rootDir), + ...findTsFiles(libDir) + ]; + + let updatedCount = 0; + + tsFiles.forEach(file => { + if (updateImportInFile(file)) { + updatedCount++; + } + }); + + console.log(`\nCompleted! Updated ${updatedCount} files.`); +} + +main(); \ No newline at end of file