Skip to content

Commit

Permalink
defaulting to direct attestation and updated links/UI
Browse files Browse the repository at this point in the history
  • Loading branch information
dagnelies committed Feb 25, 2024
1 parent 562ce75 commit 7a776a1
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import * as webauthn from '@passwordless-id/webauthn'

```html
<script type="module">
import { client } from 'https://unpkg.com/@passwordless-id/webauthn@1.3.3/dist/webauthn.min.js'
import { client } from 'https://unpkg.com/@passwordless-id/webauthn@1.4.1/dist/webauthn.min.js'
</script>
```
### Import
Expand Down
4 changes: 3 additions & 1 deletion demos/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<span>{{registrationData.authenticator.name}}</span>
</p>
<p>
<b>Type:</b>
<b>Synced?</b>
<template v-if="registrationData.authenticator">
<b-tag type="is-primary" v-if="registrationData.authenticator.synced === true">Synced / multi-device credential</b-tag>
<b-tag type="is-primary" v-if="registrationData.authenticator.synced === false">Device-bound credential</b-tag>
Expand All @@ -58,6 +58,8 @@
<b-button type="is-primary" @click="logout()">Sign Out</b-button>
</div>
</template>
<hr/>
<p>Check out the <a href="playground.html">playground</a> for more detailed usage and options.</p>
</main>

<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion demos/example-cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


<script type="module">
import { client } from 'https://unpkg.com/@passwordless-id/webauthn@1.3.3/dist/webauthn.min.js'
import { client } from 'https://unpkg.com/@passwordless-id/webauthn@1.4.1/dist/webauthn.min.js'

window.register = async function() {
console.log('Registering...')
Expand Down
3 changes: 1 addition & 2 deletions demos/js/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const app = new Vue({
},
async register() {
let res = await client.register(this.username, window.crypto.randomUUID(), {
authenticatorType: this.isRoaming ? 'roaming' : 'auto',
attestation: true
authenticatorType: this.isRoaming ? 'roaming' : 'auto'
})
console.debug(res)

Expand Down
2 changes: 0 additions & 2 deletions demos/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ <h2 class="title">Registration</h2>

<p>Resulting into:</p>

<p v-if="registration.parsed"><img :src="registration.parsed.authenticator.icon_light" /> {{registration.parsed.authenticator.name}}</p>
<pre>{{registration.parsed ?? '...'}}</pre>


<div class="notification is-warning" v-if="registration.parsed">
<p>At this point, you should store the `credential` and associate it with the user account. You will need it later to verify authentication attempts.</p>
Expand Down
2 changes: 1 addition & 1 deletion dist/webauthn.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/webauthn.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@passwordless-id/webauthn",
"version": "1.4.0",
"version": "1.4.1",
"description": "A small wrapper around the webauthn protocol to make one's life easier.",
"type": "module",
"main": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export async function register(username :string, challenge :string, options? :Re
residentKey: options.discoverable ?? 'preferred', // official default is 'discouraged'
requireResidentKey: (options.discoverable === 'required') // mainly for backwards compatibility, see https://www.w3.org/TR/webauthn/#dictionary-authenticatorSelection
},
attestation: options.attestation ? "direct" : "none"
attestation: "direct"
}

if(options.debug)
Expand Down

0 comments on commit 7a776a1

Please sign in to comment.