Files
crosscode-platform/apps/events/frontend/src/content/help/auth.tsx
T
joshuaandClaude Opus 5.5 3f3a8cad66 Require two-factor authentication for admins and supervisors
Admins and supervisors without 2FA are sent a code at their next login,
and verifying it turns 2FA on. They can change the channel but not turn
it off. Older sessions without 2FA are rejected with TWO_FACTOR_REQUIRED,
and promoting a user ends their sessions so they enrol at next login.
The requirement is skipped when no email or WhatsApp channel can deliver
a code, and TWO_FACTOR_REQUIRED_ROLES=false switches it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:00:12 +02:00

55 lines
3.0 KiB
TypeScript

import React from "react";
import { LogIn, UserPlus, KeyRound, ShieldCheck } from "lucide-react";
import { GuideItem } from "@/components/shared/GuideItem";
import type { HelpContent } from "./types";
/** Help content shared by /login, /register, and /forgot-password. */
export const authHelpContent: HelpContent = {
title: "Account help",
subtitle: "Signing in, creating an account, and resetting your password.",
quickLinks: [
{ label: "Log in", href: "/login", icon: LogIn },
{ label: "Create an account", href: "/register", icon: UserPlus },
{ label: "Forgot password", href: "/forgot-password", icon: KeyRound },
],
tabs: [
{
key: "account",
label: "Signing in & registering",
icon: LogIn,
content: (
<div className="space-y-4">
<p>You can log in with either your email address or phone number, whichever you registered with.</p>
<div className="space-y-4">
<GuideItem icon={UserPlus} title="Don't have an account yet?" tone="brand">
You don&apos;t always need one — some events let you register as a guest with just your name and email. If an event requires an account, you&apos;ll be prompted to create one right from the registration form.
</GuideItem>
<GuideItem icon={LogIn} title="Already registered as a guest?" tone="green">
If you registered as a guest before, you can still create a full account later using the same email — your past registrations will be there once you&apos;re logged in.
</GuideItem>
<GuideItem icon={ShieldCheck} title="Asked for a verification code?" tone="amber">
If you&apos;ve turned on two-factor authentication, we send a 6-digit code by email or WhatsApp after your password. Enter it within 10 minutes, or use &quot;Resend code&quot; if it doesn&apos;t arrive. Tick &quot;Trust this device&quot; to skip the code on that device for 30 days. You can turn two-factor on or off from Profile &amp; Security.
</GuideItem>
<GuideItem icon={ShieldCheck} title="Admin or supervisor?" tone="amber">
Two-factor authentication is required for admin and supervisor accounts. If it isn&apos;t on yet, your next login sends you a code, and entering it turns two-factor on. You can change whether codes come by email or WhatsApp from Profile &amp; Security, but you can&apos;t turn it off.
</GuideItem>
</div>
</div>
),
},
{
key: "password",
label: "Resetting your password",
icon: KeyRound,
content: (
<div className="space-y-4">
<p>Use &quot;Forgot your password?&quot; on the login page to get a reset link emailed to you — it expires after an hour for security.</p>
<GuideItem icon={ShieldCheck} title="Already logged in?" tone="amber">
You can change your password directly from Profile &amp; Security instead, without needing an email link.
</GuideItem>
</div>
),
},
],
};