From cad695b4a7a3813d481f542db7b9dffa636d2efa Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Wed, 3 Dec 2025 02:08:08 +0000 Subject: [PATCH] Update Discord verification to handle alphanumeric codes Modify the Discord verification input to accept alphanumeric characters and update related configurations in the API and client-side components. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 0ba1c751-a5b8-430c-9eb8-ed3da85d8c56 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/saoW2ee Replit-Helium-Checkpoint-Created: true --- .replit | 4 ++ api/discord/debug-verify.ts | 71 ---------------------------------- client/pages/DiscordVerify.tsx | 6 +-- 3 files changed, 7 insertions(+), 74 deletions(-) delete mode 100644 api/discord/debug-verify.ts diff --git a/.replit b/.replit index b28a4fdd..e58779c6 100644 --- a/.replit +++ b/.replit @@ -52,6 +52,10 @@ externalPort = 80 localPort = 8044 externalPort = 3003 +[[ports]] +localPort = 36225 +externalPort = 3002 + [[ports]] localPort = 38557 externalPort = 3000 diff --git a/api/discord/debug-verify.ts b/api/discord/debug-verify.ts deleted file mode 100644 index 91b5b29e..00000000 --- a/api/discord/debug-verify.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { createClient } from "@supabase/supabase-js"; - -export const config = { - runtime: "nodejs", -}; - -export default async function handler(req: any, res: any) { - const supabaseUrl = process.env.SUPABASE_URL || process.env.VITE_SUPABASE_URL; - const supabaseServiceRole = process.env.SUPABASE_SERVICE_ROLE; - - const debug: any = { - timestamp: new Date().toISOString(), - env: { - hasSupabaseUrl: !!supabaseUrl, - supabaseUrlPrefix: supabaseUrl?.substring(0, 30) + "...", - hasServiceRole: !!supabaseServiceRole, - serviceRolePrefix: supabaseServiceRole?.substring(0, 20) + "...", - }, - }; - - if (!supabaseUrl || !supabaseServiceRole) { - return res.status(500).json({ - error: "Missing environment variables", - debug, - }); - } - - try { - const supabase = createClient(supabaseUrl, supabaseServiceRole); - - const { data: codes, error: codesError } = await supabase - .from("discord_verifications") - .select("verification_code, discord_id, expires_at, created_at") - .order("created_at", { ascending: false }) - .limit(5); - - debug.verificationCodes = { - count: codes?.length || 0, - error: codesError?.message, - codes: codes?.map((c) => ({ - code: c.verification_code, - discord_id: c.discord_id?.substring(0, 6) + "...", - expires_at: c.expires_at, - is_expired: new Date(c.expires_at) < new Date(), - })), - }; - - const { data: links, error: linksError } = await supabase - .from("discord_links") - .select("discord_id, user_id, linked_at") - .order("linked_at", { ascending: false }) - .limit(5); - - debug.discordLinks = { - count: links?.length || 0, - error: linksError?.message, - }; - - res.status(200).json({ - status: "ok", - message: "Supabase connection working", - debug, - }); - } catch (error: any) { - res.status(500).json({ - error: "Connection failed", - message: error?.message, - debug, - }); - } -} diff --git a/client/pages/DiscordVerify.tsx b/client/pages/DiscordVerify.tsx index dd07a544..d545f636 100644 --- a/client/pages/DiscordVerify.tsx +++ b/client/pages/DiscordVerify.tsx @@ -218,15 +218,15 @@ export default function DiscordVerify() { setVerificationCode(e.target.value.replace(/\D/g, '').slice(0, 6))} + onChange={(e) => setVerificationCode(e.target.value.toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 6))} maxLength={6} disabled={isLoading} className="text-center text-3xl font-bold tracking-[0.5em] border-2 border-indigo-500/50 focus:border-indigo-500 bg-background/60 hover:bg-background/80 transition-colors" />

- Enter the 6-digit code from Discord + Enter the 6-character code from Discord