dauth-context-react 6.6.2 → 6.7.0

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/index.mjs CHANGED
@@ -239,7 +239,7 @@ function bufferToBase64url(buffer) {
239
239
  async function createPasskeyCredential(options) {
240
240
  const publicKey = {
241
241
  ...options,
242
- rp: { ...options.rp, id: window.location.hostname },
242
+ rp: options.rp,
243
243
  challenge: base64urlToBuffer(options.challenge),
244
244
  user: {
245
245
  ...options.user,
@@ -285,7 +285,7 @@ async function getPasskeyCredential(options) {
285
285
  const publicKey = {
286
286
  challenge: base64urlToBuffer(options.challenge),
287
287
  timeout: options.timeout,
288
- rpId: window.location.hostname,
288
+ rpId: options.rpId,
289
289
  userVerification: options.userVerification || "preferred",
290
290
  allowCredentials: (options.allowCredentials || []).map(
291
291
  (c) => ({
@@ -459,7 +459,9 @@ async function registerPasskeyAction(ctx, name) {
459
459
  onError(new Error("Failed to start passkey registration"));
460
460
  return null;
461
461
  }
462
- const credential = await createPasskeyCredential(startResult.data.options);
462
+ const credential = await createPasskeyCredential(
463
+ startResult.data.options
464
+ );
463
465
  const finishResult = await finishPasskeyRegistrationAPI(authProxyPath, {
464
466
  credential,
465
467
  name
@@ -2205,10 +2207,7 @@ var DauthProvider = (props) => {
2205
2207
  }
2206
2208
  };
2207
2209
  document.addEventListener("visibilitychange", handleVisibilityChange);
2208
- return () => document.removeEventListener(
2209
- "visibilitychange",
2210
- handleVisibilityChange
2211
- );
2210
+ return () => document.removeEventListener("visibilitychange", handleVisibilityChange);
2212
2211
  }, [ctx, dauthState.isAuthenticated, dauthState.isLoading]);
2213
2212
  const loginWithRedirect = useCallback2(() => {
2214
2213
  const base = `${getClientBasePath()}/${domainName}/${routes.signin}`;