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
@@ -7,16 +7,18 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { api, getMe, isModerator, unwrap } from "@/lib/api";
|
||||
import { discordError } from "@/lib/discord";
|
||||
import { claimCreator, linkAccount, signOutComputers } from "./actions";
|
||||
import { AgeCard } from "./age-card";
|
||||
import { ChallengeCard } from "./challenge-card";
|
||||
import { DiscordCard } from "./discord-card";
|
||||
import { LinkCard } from "./link-card";
|
||||
import { TokensCard } from "./tokens-card";
|
||||
import { TwoFactorCard } from "./two-factor-card";
|
||||
|
||||
export const metadata: Metadata = { title: "Account" };
|
||||
|
||||
export default async function Account({ searchParams }: { searchParams: Promise<{ welcome?: string; age?: string }> }) {
|
||||
export default async function Account({ searchParams }: { searchParams: Promise<{ welcome?: string; age?: string; error?: string }> }) {
|
||||
const me = await getMe();
|
||||
if (!me) redirect("/signin?next=/account");
|
||||
const [account, age, tokens] = await Promise.all([
|
||||
@@ -120,6 +122,8 @@ export default async function Account({ searchParams }: { searchParams: Promise<
|
||||
|
||||
<AgeCard age={age} back={params.age === "back"} />
|
||||
|
||||
{account.discord.available && <DiscordCard linked={account.discord.linked} error={discordError(params.error)} />}
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>T5DE on your computers</CardTitle>
|
||||
|
||||
Reference in new issue
Block a user