Skip to content

feat(WebAuthn): allow multiple credentials per user#29

Open
nsatragno wants to merge 3 commits into
strangerlabs:masterfrom
nsatragno:multiple_users
Open

feat(WebAuthn): allow multiple credentials per user#29
nsatragno wants to merge 3 commits into
strangerlabs:masterfrom
nsatragno:multiple_users

Conversation

@nsatragno
Copy link
Copy Markdown
Contributor

This change allows users to associate multiple credentials to their
account. When performing assertions, all the credentials are sent on the
allowList. When registering a new credential, existing credentials are
sent on the excludeList.

Updated the example to show all the credentials associated to a user.

This change is not backwards compatible.

Depends on #24

Fixes #12

Comment thread src/Webauthn.js
return res.status(403).json({
'status': 'failed',
'message': `${usernameField} ${username} already exists`,
let user = await this.store.get(username)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I think level will throw if something doesn't exist in the DB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that's being caught by the adapter

@EternalDeiwos
Copy link
Copy Markdown
Contributor

I think this is conflicting due to me merging #24; otherwise the way you're storing the many credentials is straight forward and looks good to me.

This change allows users to associate multiple credentials to their
account. When performing assertions, all the credentials are sent on the
`allowList`. When registering a new credential, existing credentials are
sent on the `excludeList`.

Updated the example to show all the credentials associated to a user.

This change is not backwards compatible.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 27, 2020

Codecov Report

❌ Patch coverage is 44.82759% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 24.87%. Comparing base (d8d63d2) to head (fdeb3ef).

Files with missing lines Patch % Lines
src/Webauthn.js 0.00% 16 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #29       +/-   ##
===========================================
+ Coverage   12.66%   24.87%   +12.20%     
===========================================
  Files           5        5               
  Lines         387      386        -1     
===========================================
+ Hits           49       96       +47     
+ Misses        338      290       -48     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor Author

@nsatragno nsatragno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased this patch, PTAL.

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.

Feature request: Allowing more than one authenticator

2 participants