carnet panel2

This commit is contained in:
alma 2025-04-20 16:40:36 +02:00
parent a5be5283ae
commit dad67c9002

View File

@ -35,14 +35,19 @@ export async function GET(request: Request) {
console.log('Using credentials for user:', credentials.username);
console.log('Accessing folder:', folder);
// Initialize WebDAV client
// Initialize WebDAV client with proper URL construction
const baseURL = process.env.NEXTCLOUD_URL;
if (!baseURL) {
throw new Error('NEXTCLOUD_URL environment variable is not set');
}
const client = createClient({
username: credentials.username,
password: credentials.password,
baseURL: process.env.NEXTCLOUD_URL,
baseURL: baseURL.endsWith('/') ? baseURL.slice(0, -1) : baseURL,
});
const folderPath = `/remote.php/dav/files/${credentials.username}/Private/${folder}`;
const folderPath = `remote.php/dav/files/${credentials.username}/Private/${folder}`;
console.log('Full folder path:', folderPath);
// List files in the specified folder