Passwordless Auth
Magic Links
Offer a frictionless sign-in experience while keeping security controls in the hands of your super admin. This guide covers the feature switches, profile controls, API endpoints, and client hook provided in AuthCore 2.8.10.
System Flow
Enable the feature (Super Admin)
Magic links, email verification, and 2FA are controlled centrally. Seed a super admin with npm run seed:admin
, create a dedicated route (for example /admin/login
) that renders <AuthForm mode="login" superAdminOnly />
or your own guarded component, and surface the toggle panel from <AdminSettings />
.
Behind the scenes, the toggles call configure()
and persist feature flags in the AuthCore metadata tables. You can also set them programmatically:
Tenant-level policies
Organization owners can only enable options that the super admin approved. Inside the dashboard, the SecuritySettings
component exposes switches for magic links, verification, and 2FA. Persist the selection to your tenant table and pass it into AuthCore during session creation:
Let users toggle magic links from their profile
Once both the super admin and the tenant allow passwordless auth, surface a preference inside the profile security tab. This keeps the UX discoverable while respecting platform-wide guard rails.
Suggested translation keys: profile.security.magicLinkTitle
, profile.security.magicLinkDescription
, profile.security.magicLinkEnable
, profile.security.magicLinkDisable
, profile.security.magicLinkStatusOn
, profile.security.magicLinkStatusOff
.
Request & verify the link
AuthCore ships REST helpers so you do not have to wire tokens manually. The generated CLI templates include the endpoints below. They honour both the global and tenant flags before issuing an email.
On the client, use the useMagicLink
hook. It exposes status
, error
, and sendMagicLink
. The hook automatically polls verification status when the user clicks the emailed link.
Translations
New copy strings for the magic link flow live in locales/en.json
and locales/fr.json
. Override them with registerDictionary()
to support additional languages.