fix(mongodb): install legacy driver during connection test

This commit is contained in:
zipg authored and GitHub committed 2026-08-14 14:45:35 +08:00
1 parent b6c4a0be0f
commit 325127419f
8 files changed
+64 -12

No files matched your search

@@ -75,7 +75,10 @@ export function mongodbAuthFailureHint(message: string): string {
const source = message.match(/source='([^']+)'/)?.[1];
if (!source || !message.includes("Exception authenticating MongoCredential")) return message;
return `${message}\n\nCurrent authentication database: ${source}. If this user was created in admin, set Authentication database to admin or add authSource=admin to URL params.`;
const verificationHint = `Current authentication database: ${source}. The server rejected these credentials. Verify the username and password, and confirm that the user was created in ${source}.`;
if (source.toLowerCase() === "admin") return `${message}\n\n${verificationHint}`;
return `${message}\n\n${verificationHint} If the user was created in admin, set Authentication database to admin or add authSource=admin to URL params.`;
}
function parseMongoUrlParams(urlParams: string | undefined): URLSearchParams {