@emporix/api-calls 1.3.0 → 1.3.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authAdapter.d.ts","sourceRoot":"","sources":["../../src/calls/authAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"authAdapter.d.ts","sourceRoot":"","sources":["../../src/calls/authAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAc7C,eAAO,MAAM,cAAc,GAAU,OAAO,MAAM,sBAQjD,CAAA;AAED,eAAO,MAAM,4BAA4B,GACvC,MAAM,IAAI,EACV,OAAO,MAAM,sBAUd,CAAA"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { getApiClient } from '../client/apiInstance';
|
|
2
|
+
// `users/me/*` is not tenant-scoped. `false` keeps the client interceptor from
|
|
3
|
+
// adding the stored tenant: the gateway rejects a disabled (e.g. migrated)
|
|
4
|
+
// tenant with 401, so the host could never load the tenants to pick another one.
|
|
5
|
+
const userScopedHeaders = (token) => ({
|
|
6
|
+
Authorization: `Bearer ${token}`,
|
|
7
|
+
'Accept-Language': '*',
|
|
8
|
+
'Content-Language': '*',
|
|
9
|
+
'Emporix-Tenant': false,
|
|
10
|
+
});
|
|
2
11
|
export const getTenantsCall = async (token) => {
|
|
3
|
-
const headers = {
|
|
4
|
-
Authorization: `Bearer ${token}`,
|
|
5
|
-
'Accept-Language': '*',
|
|
6
|
-
'Content-Language': '*',
|
|
7
|
-
};
|
|
8
12
|
const { data } = await getApiClient().get('auth-adapter/users/me/tenants', {
|
|
9
|
-
headers,
|
|
13
|
+
headers: userScopedHeaders(token),
|
|
10
14
|
});
|
|
11
15
|
return data;
|
|
12
16
|
};
|
|
13
17
|
export const updateTermsAndConditionsCall = async (user, token) => {
|
|
14
|
-
const headers = {
|
|
15
|
-
Authorization: `Bearer ${token}`,
|
|
16
|
-
'Accept-Language': '*',
|
|
17
|
-
'Content-Language': '*',
|
|
18
|
-
};
|
|
19
18
|
const { data } = await getApiClient().put('auth-adapter/users/me/profile', user, {
|
|
20
|
-
headers,
|
|
19
|
+
headers: userScopedHeaders(token),
|
|
21
20
|
});
|
|
22
21
|
return data;
|
|
23
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authAdapter.js","sourceRoot":"","sources":["../../src/calls/authAdapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,
|
|
1
|
+
{"version":3,"file":"authAdapter.js","sourceRoot":"","sources":["../../src/calls/authAdapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,+EAA+E;AAC/E,2EAA2E;AAC3E,iFAAiF;AACjF,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC;IAC5C,aAAa,EAAE,UAAU,KAAK,EAAE;IAChC,iBAAiB,EAAE,GAAG;IACtB,kBAAkB,EAAE,GAAG;IACvB,gBAAgB,EAAE,KAAK;CACxB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;IACpD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,YAAY,EAAE,CAAC,GAAG,CACvC,+BAA+B,EAC/B;QACE,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;KAClC,CACF,CAAA;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,EAC/C,IAAU,EACV,KAAa,EACb,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,YAAY,EAAE,CAAC,GAAG,CACvC,+BAA+B,EAC/B,IAAI,EACJ;QACE,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;KAClC,CACF,CAAA;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|