courrier multi account restore compose
This commit is contained in:
parent
b17ac56b50
commit
fce401a569
@ -2,6 +2,7 @@ import { NextResponse } from 'next/server';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
|
||||
import { saveUserEmailCredentials, testEmailConnection } from '@/lib/services/email-service';
|
||||
import { invalidateFolderCache } from '@/lib/redis';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
|
||||
// Define EmailCredentials interface inline since we're having import issues
|
||||
@ -138,6 +139,9 @@ export async function POST(request: Request) {
|
||||
await saveUserEmailCredentials(session.user.id, email, credentials);
|
||||
console.log(`Email account successfully added for user ${session.user.id}`);
|
||||
|
||||
// Invalidate all folder caches for this user/account
|
||||
await invalidateFolderCache(session.user.id, email, '*');
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: 'Email account added successfully'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user