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,36 @@
|
||||
// Discord on a member's account: link it to sign in with Discord too (and on T5DE's other sites), or unlink it.
|
||||
import { DiscordButton } from "@/components/discord-button";
|
||||
import { ActionForm, ErrorText, SubmitButton } from "@/components/forms";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { unlinkDiscord } from "./actions";
|
||||
|
||||
export function DiscordCard({ linked, error }: { linked: boolean; error?: string }) {
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Discord</CardTitle>
|
||||
<CardDescription>
|
||||
{linked
|
||||
? "Linked: you can sign in with Discord, here and on T5DE's other sites."
|
||||
: "Link Discord to sign in with it, here and on T5DE's other sites."}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
{error && <ErrorText>{error}</ErrorText>}
|
||||
{linked ? (
|
||||
<ActionForm action={unlinkDiscord}>
|
||||
<SubmitButton
|
||||
variant="outline"
|
||||
pendingLabel="Unlinking…"
|
||||
confirm="Unlink Discord? You'll sign in with your username and password only."
|
||||
>
|
||||
Unlink Discord
|
||||
</SubmitButton>
|
||||
</ActionForm>
|
||||
) : (
|
||||
<DiscordButton mode="link" />
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user