MasterKale / SimpleWebAuthn

WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
https://simplewebauthn.dev
MIT License
1.62k stars 137 forks source link

Add sessions to the example app #326

Closed Radiergummi closed 1 year ago

Radiergummi commented 1 year ago

This PR adds sessions to the example app, which can be used to store the current challenge in. This provides better guidance to users trying to implement passkey flows using SimpleWebAuthn. Ideally, the passkey docs could be expanded a little to bring the general concept across - once you know how it works, it's immediately clear the ephemeral challenge will need to be stored separately, and sessions are a great fit for that.

This will solve #103, #325, and aid users landing in discussion #321.

I hope this helps you a little, @MasterKale :)

MasterKale commented 1 year ago

@Radiergummi Thank you for the PR! I like this upgrade to the example project, not too complex but really helps clarify how RP's can leverage sessions for tracking expected challenges.

Aside from my one request I think this is good to go.

MasterKale commented 1 year ago

lgtm :shipit: