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

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.
@@ -340,17 +340,14 @@ export async function loginWithPasskey() {
340
340
  * Loads all authenticators and filters for WebAuthn passkeys.
341
341
  */
342
342
  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');
343
+ const res = await axios.get('/api/users/passkeys/', { withCredentials: true });
344
+ return res.data;
348
345
  }
349
346
  /**
350
347
  * Deletes a single passkey authenticator by id.
351
348
  */
352
349
  export async function deletePasskey(id) {
353
- await axios.delete(`${HEADLESS_BASE}/account/authenticators/${id}/`, { withCredentials: true });
350
+ await axios.delete(`/api/users/passkeys/${id}/`, { withCredentials: true });
354
351
  }
355
352
  // -----------------------------
356
353
  // 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.9",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "private": false,
@@ -448,25 +448,16 @@ export async function loginWithPasskey() {
448
448
  * Loads all authenticators and filters for WebAuthn passkeys.
449
449
  */
450
450
  export async function fetchPasskeys() {
451
- const res = await axios.get(
452
- `${HEADLESS_BASE}/account/authenticators/`,
453
- { withCredentials: true },
454
- );
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');
451
+ const res = await axios.get('/api/users/passkeys/', { withCredentials: true });
452
+ return res.data;
460
453
  }
461
454
 
455
+
462
456
  /**
463
457
  * Deletes a single passkey authenticator by id.
464
458
  */
465
459
  export async function deletePasskey(id) {
466
- await axios.delete(
467
- `${HEADLESS_BASE}/account/authenticators/${id}/`,
468
- { withCredentials: true },
469
- );
460
+ await axios.delete(`/api/users/passkeys/${id}/`, { withCredentials: true });
470
461
  }
471
462
 
472
463
  // -----------------------------