// What went wrong with Discord sign-in or linking, as a sentence. Better Auth sends people back with ?error=. const messages: Record = { email_not_verified: "Your Discord account's email isn't verified. Verify it in Discord, then try again.", email_not_found: "Your Discord account has no email. Add one in Discord and verify it, then try again.", account_not_linked: "This email belongs to a T5DE account. Sign in to it with your username and password, then link Discord from your account page.", account_already_linked_to_different_user: "That Discord account already signs in to another T5DE account.", access_denied: "Discord sign-in was cancelled.", }; /** The sentence for an error Discord sign-in came back with (undefined if there's none). */ export function discordError(code: string | string[] | undefined): string | undefined { if (typeof code !== "string" || !code) return undefined; return messages[code] ?? "Signing in with Discord didn't work. Try again."; }