Skip to content

Demo site enhancements - #664

Merged
aseigler merged 3 commits into
passwordless-lib:mainfrom
aseigler:demo-improvements
Sep 11, 2026
Merged

aseigler merged 3 commits into
passwordless-lib:mainfrom
aseigler:demo-improvements

Conversation

@aseigler

Copy link
Copy Markdown
Collaborator

No description provided.

…liance

- Change distributed cache interval from 8 days to 25 hours
- Update GetDistributedCacheAbsoluteExpiryTime to use buffer period semantics
- This allows cross-server caching efficiency within MDS v3.1.1 rate limit window
- Memory cache still expires at nextUpdateTime for rate limiting enforcement
Four things on the demo site were quietly not working:

Tag helpers were only registered inside _Layout.cshtml, so pages got none. The one page-level use,
<partial name="_options.cshtml" /> on the custom page, was emitted into the response as a literal
<partial> element the browser ignored. The directive belongs in _ViewImports.cshtml, where every page
picks it up.

sweetalert2 was loaded unpinned -- which now serves v11 -- next to a stylesheet pinned at v6.10.1, and
the calls still passed v8's removed "type" member instead of "icon". Every alert therefore rendered with
mismatched styling and no icon. Pinned to 11.26.25 using the .all bundle, which carries its own CSS, and
the stylesheet link dropped.

detectFIDOSupport() looked for an element with id notSupportedWarning; no page had one, and nothing ever
called the function. The "your browser does not support WebAuthn" banner could not appear. It now runs on
DOMContentLoaded, and the banner is given the id in a following commit.

The "read the source code for this demo" links pointed at /blob/main/Fido2Demo/..., which is neither the
branch (master) nor the folder (Demo) -- every one of them 404'd.

Also removed the popper.js tag: nothing on the site uses it, and Bulma does not need it.
The four scenarios each carried a full copy of the registration and authentication ceremonies -- eight
files, ~1250 lines, differing only in which options they set. Every bug in them existed four times over,
and each was real:

- After a failed fetch the catch showed an alert but did not return, so execution continued into
  `makeCredentialOptions.status` on an undefined value and died with a TypeError that masked the original
  error. Same shape after a failed navigator.credentials.create().
- Three of the four register files ended with `catch (e) { showErrorAlert(err.message ...) }` -- `err` is
  not the bound variable, so the handler itself threw ReferenceError.
- registerNewCredential() is async but was called without await inside a try, so its catch could never
  run.
- Pressing Escape at the browser prompt was reported as "the username is already registered with your
  authenticator", which is misleading: a NotAllowedError/AbortError from a dismissed prompt is now
  distinguished from a real failure and simply closes the dialog.
- The `mediation` argument was never passed to create() or get().

The ceremonies now live once in webauthn.js. Each page keeps a short file holding only the options that
make that scenario what it is -- which is what the "read the source code" links point readers at -- and
those links now name webauthn.js as well. The four scenario pages also gain the notSupportedWarning id
the previous commit's detectFIDOSupport() looks for, and the custom page's duplicated
Html.PartialAsync call is dropped so the options panel renders once rather than twice.

Net 1251 -> 669 lines, 124 of which are the vendored instant.js.
@codecov

codecov Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.52%. Comparing base (b141b59) to head (871d4f8).

Files with missing lines Patch % Lines
...rc/Fido2.AspNet/DistributedCacheMetadataService.cs 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #664      +/-   ##
==========================================
- Coverage   78.64%   78.52%   -0.13%     
==========================================
  Files          98       98              
  Lines        2548     2547       -1     
  Branches      425      424       -1     
==========================================
- Hits         2004     2000       -4     
- Misses        434      438       +4     
+ Partials      110      109       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aseigler
aseigler merged commit f2aa4cc into passwordless-lib:main Sep 11, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant