@snapdragonsnursery/react-components 1.1.1 → 1.1.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapdragonsnursery/react-components",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -104,14 +104,8 @@ const ChildSearchModal = ({
104
104
  setError(null);
105
105
 
106
106
  try {
107
- // Get access token
108
- const apiBaseUrl = process.env.VITE_COMMON_API_BASE_URL || "https://snaps-common-api.azurewebsites.net";
109
- const apiScope = apiBaseUrl.replace(/^https?:\/\//, "api://") + "/.default";
110
-
111
- const response = await instance.acquireTokenSilent({
112
- scopes: [apiScope],
113
- account: accounts[0],
114
- });
107
+ // Get function key for authentication
108
+ const functionKey = import.meta.env.VITE_COMMON_API_FUNCTION_KEY || "";
115
109
 
116
110
  // Build query parameters
117
111
  const params = new URLSearchParams({
@@ -162,13 +156,13 @@ const ChildSearchModal = ({
162
156
  // Make API call
163
157
  const apiResponse = await fetch(
164
158
  `${
165
- process.env.VITE_COMMON_API_BASE_URL ||
159
+ import.meta.env.VITE_COMMON_API_BASE_URL ||
166
160
  "https://snaps-common-api.azurewebsites.net"
167
161
  }/api/search-children?${params}`,
168
162
  {
169
163
  headers: {
170
- Authorization: `Bearer ${response.accessToken}`,
171
164
  "Content-Type": "application/json",
165
+ "x-functions-key": functionKey,
172
166
  },
173
167
  }
174
168
  );