Skip to main content
On this page

It's not a secret that passwords are unsafe. We ask users to invent a secret, remember it for years, never reuse it anywhere else, type it correctly on every device, and somehow keep it safe from attackers.

Then we build password reset flows for when all of that inevitably goes wrong.

Passwordless authentication changes the model. Instead of asking for a password, your application lets users sign in with something like a passkey, or a one-time code sent to their email address or phone.

In this article, we'll look at the most common passwordless methods and compare how they work and what each one trades off. We'll also walk through what each one looks like from the React side. We won't build the backend here; instead, we'll explain what the server needs to verify at each step.

How you use that depends on where you're starting from:

  • If you run your own backend, the React code shows you the browser side of each flow, and the server explanations give you a checklist for your endpoints. Pair them with a library such as SimpleWebAuthn for the passkey verification.
  • If you'd rather not run that backend at all, an identity provider can do the verification for you. In that case, your React code shrinks to a sign-in button. We cover that in Implementing with @asgardeo/react.

Either way, treat the code as illustrative. Each snippet shows one step of a flow, so production concerns such as routing, loading states and full error handling are mostly left out.

What passwordless means for a React developer​

For a React developer, passwordless authentication does not mean React suddenly becomes responsible for authenticating users. Your application still starts the flow, collects whatever interaction is needed, and receives an authenticated session. What changes is the credential that proves the user's identity.

The three methods you will actually ship​

The most common consumer-facing passwordless options are:

  • Passkeys - authenticate using a cryptographic credential stored by a device, credential manager, or hardware security key.
  • Magic links - send a short-lived login link to the user's email address.
  • One-time passwords (OTP) - send a short-lived code to the user's email address or mobile phone.

Where the React app's responsibility starts and ends​

Let's get one thing clear before looking at each method: your React application shouldn't be the authority deciding whether a user has successfully authenticated.

In many setups, especially when you use hosted login, React simply starts the authentication flow. The browser moves over to the identity provider, the user completes whatever authentication method is configured there, and once that succeeds, the application gets the result back.

So from React's point of view, the flow is often surprisingly simple:

Passwordless login from React's point of view
  1. ReactStarts authentication
  2. Identity providerHandles authentication
  3. ReactContinues with an authenticated user

If you build more of the login experience directly into your application, React does a little more. It might collect an email address, display a code field, or trigger a browser authentication API.

Even then, React is handling the experience rather than establishing trust. The actual verification still happens on the server or at the identity provider.

Keep that in mind as we go through each method, because how much your React application does depends on the method and how you integrate it.

Choosing a method: the comparison nobody publishes​

When choosing a passwordless method, security is only part of the decision. You also need to ask what happens when the user loses their device, whether they can sign in from a different one, what each attempt costs to deliver, and how often they'll need your support team to get back in.

Those practical questions are easy to overlook when security gets all the attention. The best choice is usually the one that balances security, usability, recoverability and cost.

Comparison table​

Here's how the four options compare:

PasskeyMagic linkEmail OTPSMS OTP
User experienceExcellent once enrolledVery simpleFamiliar, but requires copying a codeFamiliar, but requires copying a code
Device dependencyDepends on passkey provider / authenticatorRequires email accessRequires email accessRequires phone number/SIM access
Recovery pathAnother synced passkey, another authenticator, or account recoveryRecover email accountRecover email accountRecover mobile number/account
Delivery costEssentially none per loginEmail deliveryEmail deliverySMS delivery
Phishing resistanceStrongLimitedLimitedLimited
Browser supportWebAuthn support requiredMinimalMinimalMinimal

To summarize:

  • Passkeys offer some of the strongest authentication properties of the methods we're looking at. A WebAuthn credential is tied to a specific relying party, and the private key never gets sent to the website during authentication.
  • Magic links and OTP trade some of that security for extremely simple recovery and onboarding.

The recovery question that decides it​

It may sound counter-intuitive, but your recovery model decides which passwordless method you should use in the first place. A very secure primary method does not help much if recovery introduces a much weaker path back into the account.

If a user who loses every passkey gets back in through an emailed link, email is part of your authentication security model whether you intended it to be or not.

We'll come back to this properly in the account recovery section, once we've seen how each method works.

Now let's look at what each method looks like inside a React application. All three follow the same outline. React starts the flow, some proof travels to the server, and the server verifies it before creating a session. What changes is the proof and how it travels:

Where the three methods differ
  1. Passkey
    1. ReactRequests a challenge from the server
    2. Browser + authenticatorSigns the challenge with the private key
    3. ServerVerifies the signature with the stored public key
    4. Session created
    Magic link
    1. ReactSends the email address
    2. EmailDelivers a one-time link back to the app
    3. ServerVerifies the token from the link
    4. Session created
    Email / SMS OTP
    1. ReactSends the email address or phone number
    2. Email or SMSDelivers a code the user types into the app
    3. ServerVerifies the code
    4. Session created

React's part looks similar in all three. The highlighted middle step is where the security properties come from, and it's why the methods compare the way they do in the table.

Passkeys and WebAuthn in React​

We've used the terms passkeys and WebAuthn a few times already, so let's break down what each one means and how they fit together.

WebAuthn, short for Web Authentication, is the web standard that lets applications authenticate users using public-key cryptography instead of a password. It gives the browser APIs for creating a credential and later using that credential during sign-in.

A passkey is the credential the user creates and uses through that system. Users usually approve it with whatever they already use to unlock their device or credential manager, such as Face ID, Touch ID, Windows Hello or a device PIN. Passkeys can also live on hardware security keys.

Behind the scenes, a passkey is a public-private key pair. The public key is registered with your application. The private key stays with the authenticator and is used when the user later signs in, so your application never needs to receive or store it.

Adding passkeys involves two flows, which WebAuthn calls ceremonies:

  • Registration - creating a passkey and associating it with a user.
  • Authentication - using that passkey later to sign in.

What we're working with​

The rest of this section assumes a React app running in the browser and a backend that belongs to the same application. React handles the UI and calls the browser's WebAuthn API. The backend creates the challenges, verifies the responses, and stores each user's public credentials.

If you want to see the ceremonies working before writing anything yourself, there are two good places to start:

  • webauthn.io - a demo site from Duo Labs where you can register a passkey and sign in with it, right in your browser.
  • The SimpleWebAuthn example project - a small Express server with a working WebAuthn backend that you can run locally and read through.

One thing you can't do is point your React app at someone else's passkey backend. A passkey is bound to the domain it was created for, so the server verifying it has to belong to your application.

Registration ceremony​

Registration starts when a user wants to create a passkey for their account. The first step is to ask your server for a set of registration options: the instructions the browser needs to create the new credential.

WebAuthn defines what these options look like, but not the endpoint that serves them. Here, /api/passkeys/register/options is an endpoint in our own backend.

const optionsJSON = await fetch("/api/passkeys/register/options", {
method: "POST",
credentials: "include",
}).then((res) => res.json());

We assume the user is already signed in, so credentials: "include" sends their session cookie and the server knows which account the passkey is for. A simplified response might look like this:

{
"challenge": "base64url-encoded-random-value",
"rp": {
"name": "My App",
"id": "example.com"
},
"user": {
"id": "base64url-encoded-user-id",
"name": "[email protected]",
"displayName": "Alex"
},
"pubKeyCredParams": [
{
"type": "public-key",
"alg": -7
}
],
"authenticatorSelection": {
"residentKey": "required",
"userVerification": "required"
},
"timeout": 60000,
"attestation": "none"
}

There are a few things going on here:

  • rp describes the relying party: the website or service the passkey is being created for.
  • user identifies the account the new passkey belongs to.
  • pubKeyCredParams lists the public-key algorithms the server supports.
  • authenticatorSelection sets two policies. residentKey: "required" asks for a discoverable credential, one the authenticator can find without the server naming it first, which we'll need for autofill. userVerification: "required" asks the authenticator to confirm it's really the user, with a biometric or device PIN, rather than just checking that someone tapped a key.
  • challenge is a fresh random value for this registration attempt. The server checks it when the result comes back, to make sure the response belongs to the ceremony it started.

WebAuthn represents values such as challenge and user.id as binary data, but they arrive from our server as encoded JSON strings. So React converts them with a browser helper, then asks the browser to create the passkey:

const options = PublicKeyCredential.parseCreationOptionsFromJSON(optionsJSON);

const credential = await navigator.credentials.create({
publicKey: options,
});

From here, the browser takes over the interaction with the authenticator. Depending on the device and where the user keeps their passkeys, they might be prompted through Touch ID, Face ID, Windows Hello, Android device unlock, a credential manager, or a hardware security key.

Once the user approves, the authenticator creates a new public-private key pair for this credential and keeps the private key to itself. The browser returns a PublicKeyCredential containing the registration response, which holds what the server needs to register the public credential.

React then sends that response back to the server:

await fetch("/api/passkeys/register/verify", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
credentials: "include",
body: JSON.stringify(credential.toJSON()),
});

The server checks the response against the registration ceremony it started. At a minimum, it should confirm that:

  • the challenge is the one it issued for this user, hasn't expired, and hasn't been used. It should be deleted as soon as it's checked, whatever the result.
  • the response came from your application's origin and was created for your relying party ID.
  • the user verification flag is set, if your policy requires it, as ours does.
  • the credential ID isn't already registered.

If the verification succeeds, it stores the credential ID and public key against the user's account. A WebAuthn library such as SimpleWebAuthn performs most of these checks for you, but your server still has to store the challenge, pass in the expected values and decide on the policy.

At no point does your application receive the user's fingerprint, face data or device PIN. Those stay on the authenticator. Registration is now complete: the server has the public credential, the authenticator has the private key, and the user has a passkey they can sign in with.

Authentication ceremony​

When the user comes back later to sign in, the flow looks very similar to registration. This time, instead of creating a new credential, we're asking the user to prove they still have access to a passkey registered earlier.

React starts by asking the server for authentication options for this login attempt:

const optionsJSON = await fetch("/api/passkeys/login/options", {
method: "POST",
credentials: "include",
}).then((res) => res.json());

A simplified response might look like this:

{
"challenge": "base64url-encoded-random-value",
"rpId": "example.com",
"allowCredentials": [
{
"type": "public-key",
"id": "base64url-encoded-credential-id"
}
],
"timeout": 60000,
"userVerification": "required"
}

The shape is a little different from registration because we're no longer creating a credential:

  • challenge is a fresh random value for this login attempt, and rpId identifies the relying party.
  • allowCredentials lists the registered credentials allowed for this request. It can also be left out so the browser discovers a suitable passkey itself.
  • userVerification requests user verification. Asking isn't enough on its own: the server also has to check that the response says it happened. With "preferred", some logins arrive without it, and your server has to decide whether to accept them.

As before, React converts the options and hands them to the browser:

const options = PublicKeyCredential.parseRequestOptionsFromJSON(optionsJSON);

const credential = await navigator.credentials.get({
publicKey: options,
});

The browser looks for a passkey that matches the request, and the user might be asked to approve its use with Face ID, Touch ID, Windows Hello, a device PIN, or another mechanism the authenticator supports.

Once approved, the authenticator uses the passkey's private key to sign a response for this login attempt. The private key itself never leaves the authenticator.

React sends the response to /api/passkeys/login/verify, the same way it sent the registration response. The server uses the credential ID and public key stored during registration to verify it, and should confirm that:

  • the credential ID belongs to a registered passkey, and the signature verifies against that passkey's stored public key.
  • the challenge is the one it issued for this login attempt, hasn't expired, and hasn't been used.
  • the response came from your origin and your relying party ID.
  • the user verification flag is set, if your policy requires it.

If those checks succeed, the server creates a session. That step deserves the same care as the ceremony: issue a new session ID rather than reusing one from before login, in a cookie marked HttpOnly, Secure and SameSite, so page scripts can't read it, it only travels over HTTPS, and other sites can't easily trigger requests that carry it.

So the authentication ceremony can be reduced to this:

Passkey authentication ceremony
  1. ServerCreates authentication options
  2. ReactPasses them to WebAuthn
  3. BrowserFinds a matching passkey
  4. AuthenticatorSigns the challenge
  5. ReactSends the response to the server
  6. ServerVerifies it using the stored public key
  7. User is authenticated

Compared with registration, the difference is simple. During registration, the authenticator creates a key pair and the server stores the public key. During authentication, the authenticator proves it still holds the private key, and the server checks that proof with the public key.

Conditional UI and autofill​

So far, we've assumed the user clicks a dedicated Sign in with passkey button to start authentication. But what if you could offer passkeys directly through the browser's autofill suggestions, just like saved usernames and passwords?

That's what WebAuthn's conditional UI does. Instead of prompting the user straight away, the browser waits until they interact with a login field and offers an available passkey as an autofill suggestion.

Making passkeys available through autofill​

Suppose your React application has an email field:

<input
type="email"
name="email"
autoComplete="username webauthn"
placeholder="Email"
/>

The webauthn value in autoComplete tells the browser that this field can offer passkeys alongside regular autofill suggestions. On its own, though, the attribute isn't enough: React also has to start a WebAuthn request in conditional mode.

Starting a conditional authentication request​

React fetches and parses authentication options exactly as in the authentication ceremony, with one difference on the server side. The user hasn't typed anything yet, so the backend doesn't know who's signing in. It leaves out allowCredentials, and the browser finds a suitable passkey on its own.

That only works for discoverable credentials, which is why we set residentKey: "required" during registration. A passkey that isn't discoverable won't appear in autofill at all.

Then React starts the request in conditional mode:

const credential = await navigator.credentials.get({
publicKey: options,
mediation: "conditional",
});

With mediation: "conditional", the request stays pending instead of prompting the user. When they focus the email field, the browser can show something like "Use passkey for [email protected]" among the autofill suggestions. If they pick it and approve with Face ID, Touch ID or Windows Hello, the request completes.

From there, it's the regular ceremony again: React sends the response to /api/passkeys/login/verify, and the backend runs the same checks and creates a session.

What about browsers that don't support conditional UI?​

Conditional UI is an enhancement, not something your entire login experience should depend on. Before using it, check that the browser supports conditional mediation, and that parseRequestOptionsFromJSON exists too. It's newer than WebAuthn itself and missing from some browsers that otherwise support passkeys.

A conditional request can also stay pending for as long as the login page is open, because the user might never pick a passkey, so it needs to be cancellable. In React, the natural place for that is the effect that starts the request:

import { useEffect } from "react";

async function startConditionalPasskeyLogin(signal) {
if (
!window.PublicKeyCredential?.isConditionalMediationAvailable ||
!PublicKeyCredential.parseRequestOptionsFromJSON ||
!(await PublicKeyCredential.isConditionalMediationAvailable())
) {
return; // Leave the regular sign-in options to do the work.
}

// Fetch the options, call navigator.credentials.get() with
// mediation: "conditional", and send the result to the verify endpoint,
// passing `signal` to each fetch() and to get().
}

function Login() {
useEffect(() => {
const controller = new AbortController();

startConditionalPasskeyLogin(controller.signal).catch((error) => {
// AbortError: we cancelled the request. NotAllowedError: the user dismissed it.
if (error.name !== "AbortError" && error.name !== "NotAllowedError") {
console.error(error);
}
});

return () => controller.abort();
}, []);

return (
<form>
<input type="email" name="email" autoComplete="username webauthn" />
<button type="submit">Continue</button>
</form>
);
}

The cleanup function aborts the request when the component unmounts. That also covers React's Strict Mode in development, which mounts effects twice and would otherwise leave a second request hanging.

You'll need the same abort before starting any other WebAuthn request, such as one from a Sign in with passkey button, because the browser only runs one at a time. And if conditional UI isn't supported at all, users should still be able to sign in through a regular passkey button or another authentication method.

The important thing is that conditional UI doesn't change how passkeys authenticate users. It changes how users discover and select them. The same ceremony happens behind the scenes, offered through the login form instead of a separate button.

What breaks when the user gets a new device?​

Not necessarily anything. If the passkey is synced through a credential provider, it becomes available again when the user signs in on the new device. But a user might lose access to that provider, or their passkey might live on a single device or security key that's now gone, so you still need a recovery path. We'll cover that in the account recovery section.

Magic links are much simpler than passkeys. Instead of asking the user for a password, you ask for their email address and send them a short-lived sign-in link.

A basic React form might look like this:

import { useState } from "react";

function MagicLinkLogin() {
const [email, setEmail] = useState("");

async function sendLink(event) {
event.preventDefault();
await fetch("/api/auth/magic-link", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ email }),
});
}

return (
<form onSubmit={sendLink}>
<input
type="email"
value={email}
onChange={(event) => setEmail(event.target.value)}
autoComplete="email"
/>
<button type="submit">Email me a sign-in link</button>
</form>
);
}

React sends the email address to /api/auth/magic-link, and the backend creates a cryptographically strong, short-lived token and emails the user a link that might look like this:

https://app.example.com/login/callback?token=abc123

The user clicks the link, comes back to your application, and the token is sent to the backend for verification. So the basic flow is:

Magic link sign-in
  1. UserEnters their email address
  2. ReactAsks the backend to send a magic link
  3. BackendCreates a short-lived token
  4. UserReceives the email
  5. UserClicks the link
  6. BackendVerifies the token
  7. User is authenticated

Handling the callback route​

When the user clicks the link, they land on the callback route, /login/callback in our example. The callback page reads the token from the URL but doesn't send it straight away. Email security scanners often open links before the user does, so this page shouldn't sign anyone in until the user clicks:

import { useState } from "react";

function MagicLinkCallback() {
const [status, setStatus] = useState("idle");
const token = new URLSearchParams(window.location.search).get("token");

async function completeSignIn() {
setStatus("verifying");

try {
const response = await fetch("/api/auth/magic-link/verify", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
credentials: "include",
body: JSON.stringify({ token }),
});
if (!response.ok) {
throw new Error("Invalid link");
}

// The session cookie is set. Load the signed-in part of the app.
window.location.assign("/dashboard");
} catch {
setStatus("failed");
}
}

if (!token || status === "failed") {
return <p>This sign-in link is invalid or has expired.</p>;
}

return (
<button onClick={completeSignIn} disabled={status === "verifying"}>
{status === "verifying" ? "Signing you in..." : "Continue signing in"}
</button>
);
}

React isn't deciding whether the token is valid. It reads the token from the callback URL and, once the user clicks, sends it back to the backend that issued it. The backend should confirm that:

  • The token exists. Store only a hash of it, so a leaked database doesn't hand out working links.
  • It hasn't expired. Minutes, not hours, is the usual lifetime.
  • It hasn't been used. Mark it used in the same step that checks it, so two requests racing with the same token can't both succeed.

If those checks succeed, the backend authenticates the user and creates a session the same way as for passkeys.

The prefetch problem and how to survive it​

Email providers and security products open links to check for malicious websites, so the first thing that opens a magic link often isn't the user. If opening the URL uses up your one-time token, this happens:

Fragile: opening the link signs the user in
  1. Email scannerGET magic-link URL
  2. Token is immediately used up
  3. later
  4. UserClicks the link in the email
  5. Link no longer works

A React app has a subtler version of the same problem. Some scanners load the page in a headless browser and run its JavaScript, so a callback that sends the token from a useEffect as soon as the page mounts can be triggered by the scanner too.

That's why our MagicLinkCallback component waits for the user to click Continue signing in. The token is still short-lived and single use, but it's only spent after an explicit user action, which a scanner won't take.

There's one more thing to think about with magic links: the user may not open the link on the device where they started the login. They might request it on a laptop, then open the email on their phone and continue from there.

Whether you allow that is a product decision. It makes the experience more flexible, but it also means the email account alone proves the user's identity, because the original browser session is no longer part of that proof.

Email and SMS OTP in React​

OTP is the pragmatic middle ground. There's nothing to enroll and nothing permanent for the user to remember, and unlike a magic link, the login flow stays in the original browser.

The user enters their email address or phone number, receives a code, and types it back into the application.

Building an OTP input that does not fight the user​

There's a surprisingly easy way to make OTP inputs annoying: build six beautiful individual boxes.

[ 1 ] [ 8 ] [ 4 ] [ 7 ] [ 2 ] [ 9 ]

Now you have to handle focus movement, backspace, pasting six characters, arrow keys, screen readers and mobile keyboards. Unless you have a strong UX reason otherwise, a single field is wonderfully boring:

<input
name="otp"
inputMode="numeric"
autoComplete="one-time-code"
maxLength={6}
/>

Then submit the value as you would any other form field:

await fetch("/api/auth/otp/verify", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
credentials: "include",
body: JSON.stringify({
email,
code,
}),
});

On the server, a six-digit code has only a million possible values, so the checks around it matter as much as the code itself. The backend should confirm that the code:

  • was issued for this email address or phone number, and not just to someone.
  • hasn't expired. A few minutes is typical.
  • hasn't been used. Invalidate it on success, and after too many wrong attempts.

Then it creates a session the same way as the other methods.

Rate limiting and resend​

Now imagine your login page has a Resend code button, and nothing stopping someone from clicking it 500 times. You've created both an abuse mechanism and, with SMS, a potentially very expensive button.

Your OTP service needs limits around:

  • verification attempts,
  • resend attempts,
  • code lifetime,
  • requests per account,
  • requests per IP or other risk signals.

Your UI should reflect those limits instead of pretending retries are unlimited:

<button disabled={secondsRemaining > 0}>
{secondsRemaining > 0 ? `Resend in ${secondsRemaining}s` : "Resend code"}
</button>

The frontend timer is there for the user's experience. The server-side limit is what actually provides security, so don't treat one as a substitute for the other.

Why SMS is the weakest option​

SMS OTP is useful. It's familiar, nearly universal, and sometimes the only practical way to reach a user. But it shouldn't be treated as equivalent to a passkey.

SMS also introduces something email OTP doesn't: a direct delivery cost for every authentication attempt. That might be insignificant for a small application and very significant at consumer scale.

So if you're choosing between email and SMS OTP purely because both produce a six-digit code, you're looking at the least important similarity.

Passwordless and MFA are not the same thing​

This deserves its own section because the two terms get mixed up constantly.

Passwordless tells you that authentication didn't require a password. Multi-factor authentication tells you that it required more than one independent factor. Those are different properties.

A user signing in with only an email OTP is passwordless, but that isn't automatically MFA. A user signing in with a password and then an email OTP is using MFA, but they're obviously not passwordless.

Passkeys have strong authentication properties of their own, but you shouldn't turn "uses biometrics" into the blanket claim that every passkey login is automatically equivalent to whatever MFA policy your organization requires.

Design the authentication flow around the assurance you actually need, not the marketing category the login method happens to sit under.

Implementing with @asgardeo/react​

Everything we've looked at so far was deliberately low level, so you know where the boundaries are: React starts authentication and handles the UI, and something else verifies the user.

If you're using WSO2 Identity Platform, you don't need to rebuild those ceremonies inside your React application. The platform supports passkeys, magic links, email OTP and SMS OTP as configurable authentication options, so your React integration stays refreshingly small:

import {
AsgardeoProvider,
SignInButton,
SignedIn,
SignedOut,
} from "@asgardeo/react";

function App() {
return (
<AsgardeoProvider
clientId="<your-app-client-id>"
baseUrl="https://api.asgardeo.io/t/<your-organization>"
>
<SignedOut>
<SignInButton />
</SignedOut>
<SignedIn>
<Dashboard />
</SignedIn>
</AsgardeoProvider>
);
}

There isn't a separate React passkey implementation hiding inside that button. Your application starts authentication, and the login flow configured for the application decides whether the user sees a passkey, magic link, OTP or another method.

That's exactly the separation you want. Your React code should care that a user became authenticated, and your identity layer should care how that happened.

Account recovery: the part that decides whether this works​

We've spent most of this article on how users sign in. Let's finish with the part passwordless demos usually skip: how they get back in when their usual method stops working.

Picture a user who has lost their phone, their laptop and access to their old email account, all at the same time. Can they still recover their account?

Every passwordless system eventually needs an answer to some version of that question, and the answer looks different for each method.

For passkeys, synced credentials handle the ordinary case. When a user replaces a device, their passkeys can come back through their passkey provider.

But that doesn't cover everything. The user might not be able to get into their credential provider, or the passkey might have lived on a single device or security key that's now gone.

For magic links and email OTP, recovery inherits the recovery model of the user's email provider: whoever can get into that inbox can get into your app.

For SMS OTP, it inherits part of the mobile carrier's model, including how a phone number gets moved to a new SIM.

There's a catch that applies to all of them. Every fallback you add can weaken the stronger method sitting above it.

Consider this authentication policy:

  • Primary: passkey
  • Fallback: email OTP
  • Recovery: a support request sent by email

On paper, this is passkey authentication. In practice, an attacker doesn't need to defeat the passkey at all. They can go after the user's email account instead, and the fallback lets them in. An account is only as strong as the weakest way back into it.

That's why the hardest question in passwordless authentication has little to do with removing the password:

What evidence will you trust when the user's normal authenticator is gone?

Answer that first, then choose the passwordless method that fits around it.

Conclusion​

Passkeys, magic links and OTP can all remove the password field from your React application. That's where most of their similarities end.

Passkeys use public-key cryptography and give you the strongest phishing resistance of the three. Magic links turn access to an email account into a very simple sign-in. Email and SMS OTP give you a familiar option that doesn't ask users to enroll anything.

Through all of that, React's job stays fairly small: it starts the flow, presents the UI and carries the result to the backend. The verification itself always happens somewhere else, on your server or at your identity provider.

If there's one decision to make before you write any of this code, make it recovery. Choose your fallback before you choose your primary passwordless method.

We started with passwords, and the reset flows we build for when they go wrong. Going passwordless still leaves you with that problem. It just moves it to recovery, where the strongest sign-in method won't help much if the easiest way into the account is the recovery path underneath it.