react-native-my-survey-sdk 2.2.26 → 2.2.27
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
|
@@ -52,14 +52,14 @@ export async function verifyApiKey(
|
|
|
52
52
|
zone: string,
|
|
53
53
|
apiKey: string,
|
|
54
54
|
): Promise<string> {
|
|
55
|
+
const url = `${verifyURL}?zone=${encodeURIComponent(zone)}`;
|
|
55
56
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
56
57
|
console.log('[Xebo Step 0] Verifying API key');
|
|
57
|
-
console.log('URL:',
|
|
58
|
+
console.log('URL:', url);
|
|
58
59
|
|
|
59
|
-
const res = await fetch(
|
|
60
|
-
method: '
|
|
61
|
-
headers: { '
|
|
62
|
-
body: JSON.stringify({ zone, apiKey }),
|
|
60
|
+
const res = await fetch(url, {
|
|
61
|
+
method: 'GET',
|
|
62
|
+
headers: { 'x-api-key': apiKey },
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
const json = await res.json();
|
|
@@ -73,9 +73,9 @@ export async function verifyApiKey(
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
const token: string | undefined =
|
|
76
|
+
json?.access_token ??
|
|
76
77
|
json?.token ??
|
|
77
78
|
json?.data?.token ??
|
|
78
|
-
json?.access_token ??
|
|
79
79
|
json?.bearerToken ??
|
|
80
80
|
json?.data?.access_token;
|
|
81
81
|
|