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/package.json CHANGED
@@ -1,21 +1,13 @@
1
1
  {
2
2
  "name": "dauth-context-react",
3
- "version": "6.6.2",
3
+ "version": "6.7.0",
4
4
  "description": "React provider and hook for passwordless authentication via the Dauth service (BFF pattern with httpOnly cookies)",
5
5
  "license": "MIT",
6
6
  "author": "David T. Pizarro Frick",
7
7
  "keywords": [
8
8
  "react",
9
- "authentication",
10
- "passwordless",
11
- "magic-link",
12
- "passkey",
13
- "webauthn",
14
- "multi-tenant",
15
9
  "context",
16
- "provider",
17
- "hook",
18
- "dauth"
10
+ "authentication"
19
11
  ],
20
12
  "main": "dist/index.js",
21
13
  "module": "dist/index.mjs",
@@ -66,25 +58,20 @@
66
58
  }
67
59
  ],
68
60
  "devDependencies": {
69
- "@size-limit/preset-small-lib": "^12.0.0",
70
- "@testing-library/jest-dom": "~6.9.0",
71
- "@testing-library/react": "~16.3.0",
72
- "@types/react": "^19.0.0",
73
- "@types/react-dom": "^19.0.0",
74
- "@vitest/coverage-v8": "^4.0.18",
75
- "husky": "^9.0.10",
76
- "jsdom": "~28.1.0",
61
+ "@size-limit/preset-small-lib": "^12.0.1",
62
+ "@testing-library/jest-dom": "~6.9.1",
63
+ "@testing-library/react": "~16.3.2",
64
+ "@types/react": "^19.2.14",
65
+ "@types/react-dom": "^19.2.3",
66
+ "@vitest/coverage-v8": "^4.1.0",
67
+ "husky": "^9.1.7",
68
+ "jsdom": "~29.0.0",
77
69
  "prettier": "^3.8.1",
78
- "react": "^19.0.0",
79
- "react-dom": "^19.0.0",
80
- "size-limit": "^12.0.0",
81
- "tsup": "~8.5.0",
70
+ "react": "^19.2.4",
71
+ "react-dom": "^19.2.4",
72
+ "size-limit": "^12.0.1",
73
+ "tsup": "~8.5.1",
82
74
  "typescript": "~5.9.3",
83
- "vitest": "~4.0.0"
84
- },
85
- "keywords": [
86
- "react",
87
- "context",
88
- "authentication"
89
- ]
75
+ "vitest": "~4.1.0"
76
+ }
90
77
  }
package/src/index.tsx CHANGED
@@ -92,10 +92,7 @@ export const DauthProvider: React.FC<IDauthProviderProps> = (
92
92
  };
93
93
  document.addEventListener('visibilitychange', handleVisibilityChange);
94
94
  return () =>
95
- document.removeEventListener(
96
- 'visibilitychange',
97
- handleVisibilityChange
98
- );
95
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
99
96
  }, [ctx, dauthState.isAuthenticated, dauthState.isLoading]);
100
97
 
101
98
  const loginWithRedirect = useCallback(() => {
@@ -191,7 +191,9 @@ export async function registerPasskeyAction(
191
191
  }
192
192
 
193
193
  // Step 2: Execute WebAuthn ceremony in the browser
194
- const credential = await createPasskeyCredential(startResult.data.options);
194
+ const credential = await createPasskeyCredential(
195
+ startResult.data.options as Record<string, unknown>
196
+ );
195
197
 
196
198
  // Step 3: Send the credential back to the server
197
199
  const finishResult = await finishPasskeyRegistrationAPI(authProxyPath, {
package/src/webauthn.ts CHANGED
@@ -38,7 +38,7 @@ export async function createPasskeyCredential(
38
38
  ): Promise<Record<string, any>> {
39
39
  const publicKey = {
40
40
  ...options,
41
- rp: { ...options.rp, id: window.location.hostname },
41
+ rp: options.rp,
42
42
  challenge: base64urlToBuffer(options.challenge),
43
43
  user: {
44
44
  ...options.user,
@@ -105,7 +105,7 @@ export async function getPasskeyCredential(
105
105
  const publicKey: PublicKeyCredentialRequestOptions = {
106
106
  challenge: base64urlToBuffer(options.challenge),
107
107
  timeout: options.timeout,
108
- rpId: window.location.hostname,
108
+ rpId: options.rpId,
109
109
  userVerification: options.userVerification || 'preferred',
110
110
  allowCredentials: (options.allowCredentials || []).map(
111
111
  (c: { id: string; type: string; transports?: string[] }) => ({