Skip to content

fix(admin): avoid locally caught exception in PasskeyLogin#268

Merged
ascorbic merged 3 commits intoemdash-cms:mainfrom
doguabaris:main
Apr 6, 2026
Merged

fix(admin): avoid locally caught exception in PasskeyLogin#268
ascorbic merged 3 commits intoemdash-cms:mainfrom
doguabaris:main

Conversation

@doguabaris
Copy link
Copy Markdown
Contributor

Why:

The passkey login flow threw an error when navigator.credentials.get() returned no credential, but that exception was immediately caught by the local catch block in the same function. This triggered a "throw of exception caught locally" warning and made the failure path less direct.

What:

  • Handle the missing credential case inline instead of throwing locally
  • Preserve the existing error message shown to the user
  • Keep the onError callback behavior unchanged

What does this PR do?

Closes #

Type of change

  • Bug fix
  • Feature (requires approved Discussion)
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm --silent lint:json | jq '.diagnostics | length' returns 0
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

AI-generated code disclosure

  • This PR includes AI-generated code

Screenshots / test output

Why:

The passkey login flow threw an error when navigator.credentials.get()
returned no credential, but that exception was immediately caught by the
local catch block in the same function. This triggered a
"throw of exception caught locally" warning and made the failure path
less direct.

What:

- Handle the missing credential case inline instead of throwing locally
- Preserve the existing error message shown to the user
- Keep the onError callback behavior unchanged
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 5, 2026

🦋 Changeset detected

Latest commit: 1179ef1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/plugin-ai-moderation Patch
@emdash-cms/plugin-atproto Patch
@emdash-cms/plugin-audit-log Patch
@emdash-cms/plugin-color Patch
@emdash-cms/plugin-embeds Patch
@emdash-cms/plugin-forms Patch
@emdash-cms/plugin-webhook-notifier Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@doguabaris
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Apr 5, 2026
@JULJERYT
Copy link
Copy Markdown
Contributor

JULJERYT commented Apr 6, 2026

nice one

@JULJERYT
Copy link
Copy Markdown
Contributor

JULJERYT commented Apr 6, 2026

@ascorbic could you add changeset?

---
"@emdash-cms/admin": patch
---

Fixes passkey login error handling when no credential is returned from the authenticator

everything else looks good to me

@github-actions github-actions bot added size/S and removed size/XS labels Apr 6, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 6, 2026

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@268

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@268

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@268

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@268

emdash

npm i https://pkg.pr.new/emdash@268

create-emdash

npm i https://pkg.pr.new/create-emdash@268

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@268

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@268

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@268

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@268

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@268

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@268

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@268

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@268

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@268

commit: 1179ef1

@ascorbic ascorbic enabled auto-merge (squash) April 6, 2026 19:59
@ascorbic ascorbic merged commit ab21f29 into emdash-cms:main Apr 6, 2026
24 of 25 checks passed
@emdashbot emdashbot bot mentioned this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants