@micha.bigler/ui-core-micha 1.2.3 → 1.2.4

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.
@@ -180,10 +180,11 @@ async function registerPasskeyStart({ passwordless = true } = {}) {
180
180
  });
181
181
  const data = res.data || {};
182
182
  // allauth.headless: { creation_options: { publicKey: { ... } } }
183
- const creationOptionsJson = (data.creation_options && data.creation_options.publicKey) ||
184
- data.creation_options ||
183
+ // Wir wollen am Ende den INNEREN publicKey-Block haben:
184
+ const publicKeyJson = (data.creation_options && data.creation_options.publicKey) ||
185
+ data.publicKey ||
185
186
  data;
186
- return creationOptionsJson;
187
+ return publicKeyJson;
187
188
  }
188
189
  async function registerPasskeyComplete(credentialJson, name = 'Passkey') {
189
190
  const res = await axios.post(`${HEADLESS_BASE}/account/authenticators/webauthn`, {
@@ -197,10 +198,12 @@ export async function registerPasskey(name = 'Passkey') {
197
198
  if (!hasJsonWebAuthn) {
198
199
  throw new Error('Passkey JSON helpers are not available in this browser.');
199
200
  }
200
- const creationOptionsJson = await registerPasskeyStart({ passwordless: true });
201
+ // Hier bekommst du bereits den inneren publicKey-Block mit challenge etc.
202
+ const publicKeyJson = await registerPasskeyStart({ passwordless: true });
201
203
  let credential;
202
204
  try {
203
- const publicKeyOptions = window.PublicKeyCredential.parseCreationOptionsFromJSON(creationOptionsJson);
205
+ // publicKeyJson hat challenge auf Top-Level
206
+ const publicKeyOptions = window.PublicKeyCredential.parseCreationOptionsFromJSON(publicKeyJson);
204
207
  credential = await navigator.credentials.create({
205
208
  publicKey: publicKeyOptions,
206
209
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micha.bigler/ui-core-micha",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "private": false,
@@ -238,12 +238,13 @@ async function registerPasskeyStart({ passwordless = true } = {}) {
238
238
  const data = res.data || {};
239
239
 
240
240
  // allauth.headless: { creation_options: { publicKey: { ... } } }
241
- const creationOptionsJson =
241
+ // Wir wollen am Ende den INNEREN publicKey-Block haben:
242
+ const publicKeyJson =
242
243
  (data.creation_options && data.creation_options.publicKey) ||
243
- data.creation_options ||
244
+ data.publicKey ||
244
245
  data;
245
246
 
246
- return creationOptionsJson;
247
+ return publicKeyJson;
247
248
  }
248
249
 
249
250
  async function registerPasskeyComplete(credentialJson, name = 'Passkey') {
@@ -265,12 +266,14 @@ export async function registerPasskey(name = 'Passkey') {
265
266
  throw new Error('Passkey JSON helpers are not available in this browser.');
266
267
  }
267
268
 
268
- const creationOptionsJson = await registerPasskeyStart({ passwordless: true });
269
+ // Hier bekommst du bereits den inneren publicKey-Block mit challenge etc.
270
+ const publicKeyJson = await registerPasskeyStart({ passwordless: true });
269
271
 
270
272
  let credential;
271
273
  try {
274
+ // publicKeyJson hat challenge auf Top-Level
272
275
  const publicKeyOptions =
273
- window.PublicKeyCredential.parseCreationOptionsFromJSON(creationOptionsJson);
276
+ window.PublicKeyCredential.parseCreationOptionsFromJSON(publicKeyJson);
274
277
 
275
278
  credential = await navigator.credentials.create({
276
279
  publicKey: publicKeyOptions,