@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.
- package/dist/auth/authApi.js +3 -6
- package/package.json +1 -1
- package/src/auth/authApi.jsx +4 -13
package/dist/auth/authApi.js
CHANGED
|
@@ -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(
|
|
344
|
-
|
|
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(
|
|
350
|
+
await axios.delete(`/api/users/passkeys/${id}/`, { withCredentials: true });
|
|
354
351
|
}
|
|
355
352
|
// -----------------------------
|
|
356
353
|
// Aggregated API object
|
package/package.json
CHANGED
package/src/auth/authApi.jsx
CHANGED
|
@@ -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
|
-
|
|
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
|
// -----------------------------
|