@micha.bigler/ui-core-micha 1.2.8 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -336,21 +336,14 @@ export async function loginWithPasskey() {
336
336
  throw new Error(extractErrorMessage(err));
337
337
  }
338
338
  }
339
- /**
340
- * Loads all authenticators and filters for WebAuthn passkeys.
341
- */
342
339
  export async function fetchPasskeys() {
343
- const res = await axios.get(`${HEADLESS_BASE}/account/authenticators/`, { withCredentials: true });
344
- const items = Array.isArray(res.data) ? res.data : [];
345
- // allauth usually returns objects like:
346
- // { id, type, name, last_used_at, created_at, is_device_passkey, ... }
347
- return items.filter((item) => item.type === 'webauthn');
340
+ const res = await axios.get(`${USERS_BASE}/passkeys/`, // <-- nicht HEADLESS_BASE
341
+ { withCredentials: true });
342
+ return Array.isArray(res.data) ? res.data : [];
348
343
  }
349
- /**
350
- * Deletes a single passkey authenticator by id.
351
- */
352
344
  export async function deletePasskey(id) {
353
- await axios.delete(`${HEADLESS_BASE}/account/authenticators/${id}/`, { withCredentials: true });
345
+ await axios.delete(`${USERS_BASE}/passkeys/${id}/`, // <-- DRF-ViewSet-URL
346
+ { withCredentials: true });
354
347
  }
355
348
  // -----------------------------
356
349
  // Aggregated API object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micha.bigler/ui-core-micha",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "private": false,
@@ -444,27 +444,17 @@ export async function loginWithPasskey() {
444
444
  throw new Error(extractErrorMessage(err));
445
445
  }
446
446
  }
447
- /**
448
- * Loads all authenticators and filters for WebAuthn passkeys.
449
- */
450
447
  export async function fetchPasskeys() {
451
448
  const res = await axios.get(
452
- `${HEADLESS_BASE}/account/authenticators/`,
449
+ `${USERS_BASE}/passkeys/`, // <-- nicht HEADLESS_BASE
453
450
  { withCredentials: true },
454
451
  );
455
-
456
- const items = Array.isArray(res.data) ? res.data : [];
457
- // allauth usually returns objects like:
458
- // { id, type, name, last_used_at, created_at, is_device_passkey, ... }
459
- return items.filter((item) => item.type === 'webauthn');
452
+ return Array.isArray(res.data) ? res.data : [];
460
453
  }
461
454
 
462
- /**
463
- * Deletes a single passkey authenticator by id.
464
- */
465
455
  export async function deletePasskey(id) {
466
456
  await axios.delete(
467
- `${HEADLESS_BASE}/account/authenticators/${id}/`,
457
+ `${USERS_BASE}/passkeys/${id}/`, // <-- DRF-ViewSet-URL
468
458
  { withCredentials: true },
469
459
  );
470
460
  }