wandb/openui · error · Error
No credential ID found
Error message
No credential ID found
What it means
authenticate() retrieves the stored credentialID from its argument or window.localStorage and requires one to start a WebAuthn get() ceremony. If neither exists it throws 'No credential ID found', meaning no passkey was ever registered (or the stored id was cleared) on this device/browser profile.
Source
Thrown at frontend/src/lib/webauthn.ts:100
)
// TODO: might not work in windows
return crypto.subtle.importKey(
'spki',
pubKey,
{
name: 'ECDSA',
namedCurve: 'P-256',
hash: { name: 'SHA-256' }
},
false,
['verify']
)
}
export const authenticate = async (id?: string) => {
const credentialID = id ?? window.localStorage.getItem('credentialID')
if (credentialID === null) {
throw new Error('No credential ID found')
}
challenge = random(32)
const credential = await navigator.credentials.get({
publicKey: {
challenge,
allowCredentials: [
{
id: decode(credentialID),
type: 'public-key'
}
]
}
})
// TODO: verify the assertion
if (credential !== null) {
const cred = credential as PublicKeyCredential
const { clientDataJSON, authenticatorData, signature, userHandle } =View on GitHub (pinned to 42d7ab4ab6)
Solutions
- Check localStorage for 'credentialID' before calling authenticate() and route to register() instead.
- After a successful register(), persist navigator credential id as 'credentialID' in localStorage.
- Serve the app from the same origin used during registration.
- Catch this error and fall back to the registration flow.
Example fix
// before
await authenticate()
// after
if (!localStorage.getItem('credentialID')) {
await register(username)
} else {
await authenticate()
} Defensive patterns
Strategy: validation
Validate before calling
function hasStoredCredential(): boolean {
return window.localStorage.getItem('credentialID') !== null
} Try / catch
try {
await authenticate()
} catch (e) {
if (e instanceof Error && e.message === 'No credential ID found') {
await register(username) // fall back to registration
}
} Prevention
- Store credentialID in localStorage immediately after successful registration
- Check hasStoredCredential() before offering passkey login
- Remember storage is per-origin and per-browser-profile — same origin required
- Fall back to registration when no credential exists
When it happens
Trigger: Calling authenticate() with id undefined while localStorage.getItem('credentialID') returns null — e.g. fresh browser, cleared storage, private mode, or different origin than the one that registered.
Common situations: User registered a passkey on another device/browser; site data cleared; page served from a different domain/localhost port than registration; incognito browsing.
Related errors
- Unexpected response ${r.status}: ${await r.text()}
- Unexpected response ${req.status}: ${await req.text()}
- Unkown error: ${String(error)}
- body.error.message
- message
AI-assisted analysis of wandb/openui@42d7ab4ab6 (2026-09-01).
Data as JSON: /api/errors/75ea2ec9ac19dd2f.
Report an issue: GitHub.