From c136bc9247aa991f136ef8f8a8b101a9baf4e77d Mon Sep 17 00:00:00 2001 From: fuomag9 <1580624+fuomag9@users.noreply.github.com> Date: Sun, 12 Apr 2026 21:55:35 +0200 Subject: [PATCH] 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) --- src/lib/db.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/db.ts b/src/lib/db.ts index c0fdf310..81320fa9 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -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();