@snapdragonsnursery/react-components 1.1.2 → 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 +1 -1
- package/src/ChildSearchModal.jsx +3 -9
package/package.json
CHANGED
package/src/ChildSearchModal.jsx
CHANGED
|
@@ -104,14 +104,8 @@ const ChildSearchModal = ({
|
|
|
104
104
|
setError(null);
|
|
105
105
|
|
|
106
106
|
try {
|
|
107
|
-
// Get
|
|
108
|
-
const
|
|
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({
|
|
@@ -167,8 +161,8 @@ const ChildSearchModal = ({
|
|
|
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
|
);
|