Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Comments and error handling
  • Loading branch information
bfollington committed Feb 26, 2025
commit 7c24e890ffaa72b9fc0c4109f172447162b6d20f
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const AuthenticationProvider: React.FC<{ children: React.ReactNode }> = (
if (!keyStore) {
throw new Error("Key store not initialized");
}
// Pass the keyName to PassKey.get() if provided
// if we can, we prompt directly for the passed credential
const passkey = await PassKey.get({ allowCredentials: key ? [key] : [] });
const root = await passkey.createRootKey();
await keyStore.set(ROOT_KEY, root);
Expand All @@ -113,7 +113,7 @@ export const AuthenticationProvider: React.FC<{ children: React.ReactNode }> = (
const passphraseAuthenticate = useCallback(
async (mnemonic: string) => {
if (!keyStore) {
return;
throw new Error("Key store not initialized");
}
const root = await Identity.fromMnemonic(mnemonic);
await keyStore.set(ROOT_KEY, root);
Expand Down
3 changes: 2 additions & 1 deletion typescript/packages/jumble/src/views/AuthenticationView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function AuthenticationView() {
);

useEffect(() => {
const methods: AuthMethod[] = []; // Passphrase always available
const methods: AuthMethod[] = [];
// Add passkey if available
const isPasskeyAvailable =
window.location.hostname !== "localhost" && window.PublicKeyCredential !== undefined;
Expand All @@ -134,6 +134,7 @@ export function AuthenticationView() {
methods.push(AUTH_METHOD_PASSKEY);
}

// Passphrase always available, but second in list
methods.push(AUTH_METHOD_PASSPHRASE);

setAvailableMethods(methods);
Expand Down
Loading