Revert hash suffix on env-synced OAuth provider IDs

Use plain slug (e.g. "dex" not "dex-RGV4") for predictable callback URLs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
fuomag9
2026-04-12 21:55:35 +02:00
parent 66f8e32df5
commit c136bc9247

View File

@@ -215,11 +215,8 @@ function runEnvProviderSync() {
}
const name = config.oauth.providerName;
// Use a slug-based ID so the OAuth callback URL is predictable, with hash suffix to avoid collisions
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "oauth";
// Append a short hash of the exact name to avoid collisions (e.g. "Google!" vs "Google?")
const nameHash = Buffer.from(name).toString("base64url").slice(0, 6);
const providerId = `${slug}-${nameHash}`;
// Use a slug-based ID so the OAuth callback URL is predictable
const providerId = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "oauth";
const existing = db.select().from(oauthProviders).where(eq(oauthProviders.name, name)).get();
const now = new Date().toISOString();