diff --git a/app/[section]/page.tsx b/app/[section]/page.tsx index a65d0d7b..d8121f7b 100644 --- a/app/[section]/page.tsx +++ b/app/[section]/page.tsx @@ -10,11 +10,13 @@ const menuItems = { missions: "https://example.com/missions" } -interface SectionParams { - section: string; -} +type PageProps = { + params: { + section: string; + }; +}; -export default async function SectionPage({ params }: { params: SectionParams }) { +export default async function SectionPage({ params }: PageProps) { const section = params?.section ? String(params.section) : ''; const iframeUrl = menuItems[section as keyof typeof menuItems]; diff --git a/lib/services/email-service.ts b/lib/services/email-service.ts index 92e8e868..8e6bb09c 100644 --- a/lib/services/email-service.ts +++ b/lib/services/email-service.ts @@ -1379,50 +1379,4 @@ export async function testEmailConnection(credentials: EmailCredentials): Promis error: `IMAP connection failed: ${error instanceof Error ? error.message : 'Unknown error'}` }; } -} - -/** - * Force recaching of user credentials - * This function is used to refresh credentials in Redis cache - */ -export async function forceRecacheUserCredentials(userId: string): Promise { - try { - // Get credentials from database - const accounts = await prisma.mailCredentials.findMany({ - where: { userId } - }); - - if (!accounts || accounts.length === 0) { - console.log(`No email accounts found for user ${userId}`); - return false; - } - - // Recache each account's credentials - for (const account of accounts) { - const credentials: EmailCredentials = { - host: account.host, - port: account.port, - email: account.email, - password: account.password, - secure: account.secure, - smtp_host: account.smtp_host || undefined, - smtp_port: account.smtp_port || undefined, - smtp_secure: account.smtp_secure || undefined, - display_name: account.display_name || undefined, - color: account.color || undefined - }; - - await cacheEmailCredentials(userId, account.id, credentials); - console.log(`Recached credentials for user ${userId}, account ${account.id}`); - - // Invalidate other caches related to this account - await invalidateFolderCache(userId, account.id, '*'); - await invalidateEmailContentCache(userId, account.id, '*'); - } - - return true; - } catch (error) { - console.error(`Error recaching credentials for user ${userId}:`, error); - return false; - } } \ No newline at end of file