File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
typescript/packages/jumble/src Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ export const AuthenticationProvider: React.FC<{ children: React.ReactNode }> = (
9191 if ( ! keyStore ) {
9292 throw new Error ( "Key store not initialized" ) ;
9393 }
94- // Pass the keyName to PassKey.get() if provided
94+ // if we can, we prompt directly for the passed credential
9595 const passkey = await PassKey . get ( { allowCredentials : key ? [ key ] : [ ] } ) ;
9696 const root = await passkey . createRootKey ( ) ;
9797 await keyStore . set ( ROOT_KEY , root ) ;
@@ -113,7 +113,7 @@ export const AuthenticationProvider: React.FC<{ children: React.ReactNode }> = (
113113 const passphraseAuthenticate = useCallback (
114114 async ( mnemonic : string ) => {
115115 if ( ! keyStore ) {
116- return ;
116+ throw new Error ( "Key store not initialized" ) ;
117117 }
118118 const root = await Identity . fromMnemonic ( mnemonic ) ;
119119 await keyStore . set ( ROOT_KEY , root ) ;
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ export function AuthenticationView() {
125125 ) ;
126126
127127 useEffect ( ( ) => {
128- const methods : AuthMethod [ ] = [ ] ; // Passphrase always available
128+ const methods : AuthMethod [ ] = [ ] ;
129129 // Add passkey if available
130130 const isPasskeyAvailable =
131131 window . location . hostname !== "localhost" && window . PublicKeyCredential !== undefined ;
@@ -134,6 +134,7 @@ export function AuthenticationView() {
134134 methods . push ( AUTH_METHOD_PASSKEY ) ;
135135 }
136136
137+ // Passphrase always available, but second in list
137138 methods . push ( AUTH_METHOD_PASSPHRASE ) ;
138139
139140 setAvailableMethods ( methods ) ;
You can’t perform that action at this time.
0 commit comments