File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @authsignal/browser" ,
3- "version" : " 1.14.1 " ,
3+ "version" : " 1.15.0 " ,
44 "type" : " module" ,
55 "main" : " dist/index.js" ,
66 "module" : " dist/index.js" ,
Original file line number Diff line number Diff line change 44 AuthenticationResponseJSON ,
55 RegistrationResponseJSON ,
66 AuthenticatorAttachment ,
7+ PublicKeyCredentialHint ,
78} from "@simplewebauthn/browser" ;
89
910import { PasskeyApiClient } from "./api/passkey-api-client" ;
@@ -25,6 +26,7 @@ type SignUpParams = {
2526 username ?: string ;
2627 displayName ?: string ;
2728 authenticatorAttachment ?: AuthenticatorAttachment | null ;
29+ hints ?: PublicKeyCredentialHint [ ] ;
2830 useAutoRegister ?: boolean ;
2931 useCookies ?: boolean ;
3032} ;
@@ -73,6 +75,7 @@ export class Passkey {
7375 displayName,
7476 token,
7577 authenticatorAttachment = "platform" ,
78+ hints,
7679 useAutoRegister = false ,
7780 useCookies = false ,
7881 } : SignUpParams ) : Promise < AuthsignalResponse < SignUpResponse > > {
@@ -103,7 +106,9 @@ export class Passkey {
103106 }
104107
105108 try {
106- const registrationResponse = await startRegistration ( { optionsJSON : optionsResponse . options , useAutoRegister} ) ;
109+ const optionsJSON = hints ? { ...optionsResponse . options , hints} : optionsResponse . options ;
110+
111+ const registrationResponse = await startRegistration ( { optionsJSON, useAutoRegister} ) ;
107112
108113 const addAuthenticatorResponse = await this . api . addAuthenticator ( {
109114 registrationCredential : registrationResponse ,
Original file line number Diff line number Diff line change 33 startRegistration ,
44 AuthenticationResponseJSON ,
55 RegistrationResponseJSON ,
6+ PublicKeyCredentialHint ,
67} from "@simplewebauthn/browser" ;
78
89import { TokenCache } from "./token-cache" ;
@@ -38,7 +39,7 @@ export class SecurityKey {
3839 this . enableLogging = enableLogging ;
3940 }
4041
41- async enroll ( ) : Promise < AuthsignalResponse < EnrollResponse > > {
42+ async enroll ( { hints } : { hints ?: PublicKeyCredentialHint [ ] } = { } ) : Promise < AuthsignalResponse < EnrollResponse > > {
4243 if ( ! this . cache . token ) {
4344 return this . cache . handleTokenNotSetError ( ) ;
4445 }
@@ -54,7 +55,9 @@ export class SecurityKey {
5455 }
5556
5657 try {
57- const registrationResponse = await startRegistration ( { optionsJSON : optionsResponse } ) ;
58+ const optionsJSON = hints ? { ...optionsResponse , hints} : optionsResponse ;
59+
60+ const registrationResponse = await startRegistration ( { optionsJSON} ) ;
5861
5962 const addAuthenticatorResponse = await this . api . addAuthenticator ( {
6063 registrationCredential : registrationResponse ,
You can’t perform that action at this time.
0 commit comments