fix(passkey): allow no-username passkey login with discoverable credentials

Remove the username requirement check that was blocking passkey login without
entering a username. The backend already supports discoverable credentials mode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
EstrellaXD
2026-01-26 13:22:57 +01:00
parent bfb94145cb
commit f2f00a9f82

View File

@@ -12,16 +12,10 @@ const isPasskeyLoading = ref(false);
const isLoginLoading = ref(false);
async function handlePasskeyLogin() {
if (!user.username) {
const message = useMessage();
const { t } = useMyI18n();
message.warning(t('notify.please_enter', [t('login.username')]));
return;
}
isPasskeyLoading.value = true;
try {
await loginWithPasskey(user.username);
// Pass username if provided, otherwise use discoverable credentials mode
await loginWithPasskey(user.username || undefined);
} finally {
isPasskeyLoading.value = false;
}