fix(native): the handoff's passkey sign-in lives in native/browserSignIn, so the page hook reaches no API on its own

This commit is contained in:
Maurice
2026-11-08 18:33:00 +01:00
parent cd1f39377d
commit afb6eae4c8
4 changed files with 32 additions and 25 deletions
@@ -1,9 +1,7 @@
import { startAuthentication } from '@simplewebauthn/browser';
import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router';
import { useShallow } from 'zustand/react/shallow';
import { authApi } from '../../api/client';
import { HANDOFF_PATH, rememberHandoffReturn, requestHandoffCode } from '../../native/browserSignIn';
import { HANDOFF_PATH, rememberHandoffReturn, requestHandoffCode, signInWithPasskey } from '../../native/browserSignIn';
import { APP_URL_SCHEME } from '../../native/trekShell';
import { useAuthStore } from '../../store/authStore';
@@ -65,9 +63,7 @@ export function useNativeHandoff() {
const continueWithPasskey = async (): Promise<void> => {
setStatus('sending');
try {
const options = await authApi.passkey.loginOptions();
const assertion = await startAuthentication({ optionsJSON: options });
await authApi.passkey.loginVerify(assertion);
await signInWithPasskey();
await loadUser({ silent: true });
} catch (err: unknown) {
const name = (err as { name?: string })?.name;