Discord sign-in and basic accounts
Discord sign-in makes a basic account (Discord's verified email, no username or password) for T5DE's other sites; it finishes setting up with a username and password to use the hub. Implicit linking by email is off; members link Discord from their account page. Better Auth 1.7.26.
This commit is contained in:
1 parent
a66a3a4b6a
commit
f0a9661f8e
24 files changed
+5214
-173
No files matched your search
@@ -0,0 +1,15 @@
|
||||
// What went wrong with Discord sign-in or linking, as a sentence. Better Auth sends people back with ?error=<code>.
|
||||
const messages: Record<string, string> = {
|
||||
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.";
|
||||
}
|
||||
Reference in new issue
Block a user