diff --git a/ui/src/pages/OnboardingPage.tsx b/ui/src/pages/OnboardingPage.tsx index f78b16d..5f2ecd7 100644 --- a/ui/src/pages/OnboardingPage.tsx +++ b/ui/src/pages/OnboardingPage.tsx @@ -20,6 +20,7 @@ export function OnboardingPage() { const [error, setError] = useState(null); const [slugAvailable, setSlugAvailable] = useState(null); const [checkingSlug, setCheckingSlug] = useState(false); + const [showPasskeyOffer, setShowPasskeyOffer] = useState(false); const debounceRef = useRef>(undefined); const slug = toSlug(name); @@ -50,6 +51,17 @@ export function OnboardingPage() { setLoading(true); try { await api.post('/onboarding/tenant', { name, slug }); + // Check if passkeys are enabled in vendor policy + try { + const config = await fetch('/platform/api/config').then(r => r.json()); + if (config.vendorAuthPolicy?.passkeyEnabled) { + setShowPasskeyOffer(true); + setLoading(false); + return; // Don't redirect yet + } + } catch { + // Ignore — proceed without passkey offer + } // Tenant created — force a fresh OIDC sign-in so the Logto SDK gets // new tokens that include the org membership just created. The existing // Logto session cookie means the user won't see a login form — Logto @@ -66,6 +78,34 @@ export function OnboardingPage() { } } + async function handleSkipPasskey() { + await signIn(`${window.location.origin}/platform/callback`); + } + + if (showPasskeyOffer) { + return ( +
+
+ +
+
+

Secure your account

+

+ Add a passkey to sign in faster with your fingerprint, face, or security key. +

+
+
+ +
+
+
+
+
+ ); + } + return (