@micha.bigler/ui-core-micha 1.2.9 → 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,18 +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('/api/users/passkeys/', { withCredentials: true });
344
- return res.data;
340
+ const res = await axios.get(`${USERS_BASE}/passkeys/`, // <-- nicht HEADLESS_BASE
341
+ { withCredentials: true });
342
+ return Array.isArray(res.data) ? res.data : [];
345
343
  }
346
- /**
347
- * Deletes a single passkey authenticator by id.
348
- */
349
344
  export async function deletePasskey(id) {
350
- await axios.delete(`/api/users/passkeys/${id}/`, { withCredentials: true });
345
+ await axios.delete(`${USERS_BASE}/passkeys/${id}/`, // <-- DRF-ViewSet-URL
346
+ { withCredentials: true });
351
347
  }
352
348
  // -----------------------------
353
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.9",
3
+ "version": "1.2.10",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "private": false,
@@ -444,20 +444,19 @@ 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
- const res = await axios.get('/api/users/passkeys/', { withCredentials: true });
452
- return res.data;
448
+ const res = await axios.get(
449
+ `${USERS_BASE}/passkeys/`, // <-- nicht HEADLESS_BASE
450
+ { withCredentials: true },
451
+ );
452
+ return Array.isArray(res.data) ? res.data : [];
453
453
  }
454
454
 
455
-
456
- /**
457
- * Deletes a single passkey authenticator by id.
458
- */
459
455
  export async function deletePasskey(id) {
460
- await axios.delete(`/api/users/passkeys/${id}/`, { withCredentials: true });
456
+ await axios.delete(
457
+ `${USERS_BASE}/passkeys/${id}/`, // <-- DRF-ViewSet-URL
458
+ { withCredentials: true },
459
+ );
461
460
  }
462
461
 
463
462
  // -----------------------------