@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.
- package/dist/auth/authApi.js +5 -12
- package/package.json +1 -1
- package/src/auth/authApi.jsx +3 -13
package/dist/auth/authApi.js
CHANGED
|
@@ -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(`${
|
|
344
|
-
|
|
345
|
-
|
|
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(`${
|
|
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
package/src/auth/authApi.jsx
CHANGED
|
@@ -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
|
-
`${
|
|
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
|
-
`${
|
|
457
|
+
`${USERS_BASE}/passkeys/${id}/`, // <-- DRF-ViewSet-URL
|
|
468
458
|
{ withCredentials: true },
|
|
469
459
|
);
|
|
470
460
|
}
|