@memori.ai/memori-api-client 6.7.8 → 6.8.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/CHANGELOG.md +14 -0
- package/dist/backend/userPwl.d.ts +2 -2
- package/dist/backend/userPwl.js +7 -4
- package/dist/backend/userPwl.js.map +1 -1
- package/dist/backend.d.ts +4 -4
- package/dist/index.d.ts +4 -4
- package/esm/backend/userPwl.d.ts +2 -2
- package/esm/backend/userPwl.js +7 -4
- package/esm/backend/userPwl.js.map +1 -1
- package/esm/backend.d.ts +4 -4
- package/esm/index.d.ts +4 -4
- package/package.json +1 -1
- package/src/backend/userPwl.ts +11 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [6.8.0](https://github.com/memori-ai/memori-api-client/compare/v6.7.9...v6.8.0) (2025-07-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* enhance pwlUserLogin to support optional redirect URL ([ec31e18](https://github.com/memori-ai/memori-api-client/commit/ec31e189df218fbe96ffdd4ba8206a4f92b1d4a7))
|
|
9
|
+
|
|
10
|
+
## [6.7.9](https://github.com/memori-ai/memori-api-client/compare/v6.7.8...v6.7.9) (2025-07-18)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* jwt login method ([bb71e01](https://github.com/memori-ai/memori-api-client/commit/bb71e01e1c05e99642cfb8b539e5cb09e2cefda7))
|
|
16
|
+
|
|
3
17
|
## [6.7.8](https://github.com/memori-ai/memori-api-client/compare/v6.7.7...v6.7.8) (2025-07-17)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResponseSpec, User, UserFilters } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
|
-
pwlUserLogin: (user: User) => Promise<ResponseSpec & {
|
|
3
|
+
pwlUserLogin: (user: User, redirectTo?: string) => Promise<ResponseSpec & {
|
|
4
4
|
user: User;
|
|
5
5
|
token?: string | undefined;
|
|
6
6
|
flowID?: string | undefined;
|
|
@@ -27,7 +27,7 @@ declare const _default: (apiUrl: string) => {
|
|
|
27
27
|
pwlCreateUser: (authToken: string, user: Partial<User>) => Promise<ResponseSpec & {
|
|
28
28
|
user: User;
|
|
29
29
|
}>;
|
|
30
|
-
pwlLoginWithJWT: (
|
|
30
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<ResponseSpec & {
|
|
31
31
|
user: User;
|
|
32
32
|
token?: string | undefined;
|
|
33
33
|
flowID?: string | undefined;
|
package/dist/backend/userPwl.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const apiFetcher_1 = require("../apiFetcher");
|
|
4
4
|
exports.default = (apiUrl) => ({
|
|
5
|
-
pwlUserLogin: (user) => (0, apiFetcher_1.apiFetcher)('/PwlLogin', {
|
|
5
|
+
pwlUserLogin: (user, redirectTo) => (0, apiFetcher_1.apiFetcher)('/PwlLogin', {
|
|
6
6
|
apiUrl,
|
|
7
|
-
body: user,
|
|
7
|
+
body: { ...user, redirectTo: redirectTo !== null && redirectTo !== void 0 ? redirectTo : '' },
|
|
8
8
|
method: 'POST',
|
|
9
9
|
}),
|
|
10
10
|
pwlUserLogout: (authToken) => (0, apiFetcher_1.apiFetcher)(`/PwlLogout/${authToken}`, {
|
|
@@ -44,9 +44,12 @@ exports.default = (apiUrl) => ({
|
|
|
44
44
|
body: user,
|
|
45
45
|
method: 'POST',
|
|
46
46
|
}),
|
|
47
|
-
pwlLoginWithJWT: (
|
|
47
|
+
pwlLoginWithJWT: (jwtToken, tenant, secretKey) => (0, apiFetcher_1.apiFetcher)('/LoginWithJWT', {
|
|
48
48
|
apiUrl,
|
|
49
|
-
body: {
|
|
49
|
+
body: { jwtToken, tenant },
|
|
50
|
+
headers: {
|
|
51
|
+
'X-Memori-Trusted-App': secretKey,
|
|
52
|
+
},
|
|
50
53
|
method: 'POST',
|
|
51
54
|
}),
|
|
52
55
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userPwl.js","sourceRoot":"","sources":["../../src/backend/userPwl.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,CAAC,IAAU,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"userPwl.js","sourceRoot":"","sources":["../../src/backend/userPwl.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,CAAC,IAAU,EAAE,UAAmB,EAAE,EAAE,CAChD,IAAA,uBAAU,EAAC,WAAW,EAAE;QACtB,MAAM;QACN,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,EAAE;QAC/C,MAAM,EAAE,MAAM;KACf,CAEA;IAMH,aAAa,EAAE,CAAC,SAAiB,EAAE,EAAE,CACnC,IAAA,uBAAU,EAAC,cAAc,SAAS,EAAE,EAAE;QACpC,MAAM;QACN,MAAM,EAAE,MAAM;KACf,CAA0B;IAO7B,iBAAiB,EAAE,CAAC,SAAiB,EAAE,EAAE,CACvC,IAAA,uBAAU,EAAC,YAAY,SAAS,EAAE,EAAE;QAClC,MAAM;KACP,CAIA;IAQH,UAAU,EAAE,CAAC,SAAiB,EAAE,MAAc,EAAE,EAAE,CAChD,IAAA,uBAAU,EAAC,YAAY,SAAS,IAAI,MAAM,EAAE,EAAE;QAC5C,MAAM;KACP,CAIA;IAOH,eAAe,EAAE,CAAC,SAAiB,EAAE,EAAE,CACrC,IAAA,uBAAU,EAAC,aAAa,SAAS,EAAE,EAAE;QACnC,MA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string) => {
|
|
|
159
159
|
updateIntegration: (authToken: string, integrationID: string, integration: import("./types").Integration) => Promise<import("./types").ResponseSpec & {
|
|
160
160
|
integration: import("./types").Integration;
|
|
161
161
|
}>;
|
|
162
|
-
pwlUserLogin: (user: import("./types").User) => Promise<import("./types").ResponseSpec & {
|
|
162
|
+
pwlUserLogin: (user: import("./types").User, redirectTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
163
163
|
user: import("./types").User;
|
|
164
164
|
token?: string | undefined;
|
|
165
165
|
flowID?: string | undefined;
|
|
@@ -186,7 +186,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
186
186
|
pwlCreateUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
187
187
|
user: import("./types").User;
|
|
188
188
|
}>;
|
|
189
|
-
pwlLoginWithJWT: (
|
|
189
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<import("./types").ResponseSpec & {
|
|
190
190
|
user: import("./types").User;
|
|
191
191
|
token?: string | undefined;
|
|
192
192
|
flowID?: string | undefined;
|
|
@@ -468,7 +468,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
468
468
|
}>;
|
|
469
469
|
};
|
|
470
470
|
userPwl: {
|
|
471
|
-
pwlUserLogin: (user: import("./types").User) => Promise<import("./types").ResponseSpec & {
|
|
471
|
+
pwlUserLogin: (user: import("./types").User, redirectTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
472
472
|
user: import("./types").User;
|
|
473
473
|
token?: string | undefined;
|
|
474
474
|
flowID?: string | undefined;
|
|
@@ -495,7 +495,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
495
495
|
pwlCreateUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
496
496
|
user: import("./types").User;
|
|
497
497
|
}>;
|
|
498
|
-
pwlLoginWithJWT: (
|
|
498
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<import("./types").ResponseSpec & {
|
|
499
499
|
user: import("./types").User;
|
|
500
500
|
token?: string | undefined;
|
|
501
501
|
flowID?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -917,7 +917,7 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
917
917
|
updateIntegration: (authToken: string, integrationID: string, integration: import("./types").Integration) => Promise<import("./types").ResponseSpec & {
|
|
918
918
|
integration: import("./types").Integration;
|
|
919
919
|
}>;
|
|
920
|
-
pwlUserLogin: (user: import("./types").User) => Promise<import("./types").ResponseSpec & {
|
|
920
|
+
pwlUserLogin: (user: import("./types").User, redirectTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
921
921
|
user: import("./types").User;
|
|
922
922
|
token?: string | undefined;
|
|
923
923
|
flowID?: string | undefined;
|
|
@@ -944,7 +944,7 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
944
944
|
pwlCreateUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
945
945
|
user: import("./types").User;
|
|
946
946
|
}>;
|
|
947
|
-
pwlLoginWithJWT: (
|
|
947
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<import("./types").ResponseSpec & {
|
|
948
948
|
user: import("./types").User;
|
|
949
949
|
token?: string | undefined;
|
|
950
950
|
flowID?: string | undefined;
|
|
@@ -1226,7 +1226,7 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1226
1226
|
}>;
|
|
1227
1227
|
};
|
|
1228
1228
|
userPwl: {
|
|
1229
|
-
pwlUserLogin: (user: import("./types").User) => Promise<import("./types").ResponseSpec & {
|
|
1229
|
+
pwlUserLogin: (user: import("./types").User, redirectTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
1230
1230
|
user: import("./types").User;
|
|
1231
1231
|
token?: string | undefined;
|
|
1232
1232
|
flowID?: string | undefined;
|
|
@@ -1253,7 +1253,7 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1253
1253
|
pwlCreateUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
1254
1254
|
user: import("./types").User;
|
|
1255
1255
|
}>;
|
|
1256
|
-
pwlLoginWithJWT: (
|
|
1256
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<import("./types").ResponseSpec & {
|
|
1257
1257
|
user: import("./types").User;
|
|
1258
1258
|
token?: string | undefined;
|
|
1259
1259
|
flowID?: string | undefined;
|
package/esm/backend/userPwl.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResponseSpec, User, UserFilters } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
|
-
pwlUserLogin: (user: User) => Promise<ResponseSpec & {
|
|
3
|
+
pwlUserLogin: (user: User, redirectTo?: string) => Promise<ResponseSpec & {
|
|
4
4
|
user: User;
|
|
5
5
|
token?: string | undefined;
|
|
6
6
|
flowID?: string | undefined;
|
|
@@ -27,7 +27,7 @@ declare const _default: (apiUrl: string) => {
|
|
|
27
27
|
pwlCreateUser: (authToken: string, user: Partial<User>) => Promise<ResponseSpec & {
|
|
28
28
|
user: User;
|
|
29
29
|
}>;
|
|
30
|
-
pwlLoginWithJWT: (
|
|
30
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<ResponseSpec & {
|
|
31
31
|
user: User;
|
|
32
32
|
token?: string | undefined;
|
|
33
33
|
flowID?: string | undefined;
|
package/esm/backend/userPwl.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { apiFetcher } from '../apiFetcher';
|
|
2
2
|
export default (apiUrl) => ({
|
|
3
|
-
pwlUserLogin: (user) => apiFetcher('/PwlLogin', {
|
|
3
|
+
pwlUserLogin: (user, redirectTo) => apiFetcher('/PwlLogin', {
|
|
4
4
|
apiUrl,
|
|
5
|
-
body: user,
|
|
5
|
+
body: { ...user, redirectTo: redirectTo !== null && redirectTo !== void 0 ? redirectTo : '' },
|
|
6
6
|
method: 'POST',
|
|
7
7
|
}),
|
|
8
8
|
pwlUserLogout: (authToken) => apiFetcher(`/PwlLogout/${authToken}`, {
|
|
@@ -42,9 +42,12 @@ export default (apiUrl) => ({
|
|
|
42
42
|
body: user,
|
|
43
43
|
method: 'POST',
|
|
44
44
|
}),
|
|
45
|
-
pwlLoginWithJWT: (
|
|
45
|
+
pwlLoginWithJWT: (jwtToken, tenant, secretKey) => apiFetcher('/LoginWithJWT', {
|
|
46
46
|
apiUrl,
|
|
47
|
-
body: {
|
|
47
|
+
body: { jwtToken, tenant },
|
|
48
|
+
headers: {
|
|
49
|
+
'X-Memori-Trusted-App': secretKey,
|
|
50
|
+
},
|
|
48
51
|
method: 'POST',
|
|
49
52
|
}),
|
|
50
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userPwl.js","sourceRoot":"","sources":["../../src/backend/userPwl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,CAAC,IAAU,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"userPwl.js","sourceRoot":"","sources":["../../src/backend/userPwl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,YAAY,EAAE,CAAC,IAAU,EAAE,UAAmB,EAAE,EAAE,CAChD,UAAU,CAAC,WAAW,EAAE;QACtB,MAAM;QACN,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,EAAE;QAC/C,MAAM,EAAE,MAAM;KACf,CAEA;IAMH,aAAa,EAAE,CAAC,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E;QAClC,MAAM;QACN,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,MAAM;KACf,CAA2C;IAS9C,eAAe,EAAE,CAAC,QAAgB,EAAE,MAAc,EAAE,SAAiB,EAAE,EAAE,CACvE,UAAU,CAAC,eAAe,EAAE;QAC1B,MAAM;QACN,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;QAC1B,OAAO,EAAE;YACP,sBAAsB,EAAE,SAAS;SAClC;QACD,MAAM,EAAE,MAAM;KACf,CAEA;CACJ,CAAC,CAAC"}
|
package/esm/backend.d.ts
CHANGED
|
@@ -159,7 +159,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
159
159
|
updateIntegration: (authToken: string, integrationID: string, integration: import("./types").Integration) => Promise<import("./types").ResponseSpec & {
|
|
160
160
|
integration: import("./types").Integration;
|
|
161
161
|
}>;
|
|
162
|
-
pwlUserLogin: (user: import("./types").User) => Promise<import("./types").ResponseSpec & {
|
|
162
|
+
pwlUserLogin: (user: import("./types").User, redirectTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
163
163
|
user: import("./types").User;
|
|
164
164
|
token?: string | undefined;
|
|
165
165
|
flowID?: string | undefined;
|
|
@@ -186,7 +186,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
186
186
|
pwlCreateUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
187
187
|
user: import("./types").User;
|
|
188
188
|
}>;
|
|
189
|
-
pwlLoginWithJWT: (
|
|
189
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<import("./types").ResponseSpec & {
|
|
190
190
|
user: import("./types").User;
|
|
191
191
|
token?: string | undefined;
|
|
192
192
|
flowID?: string | undefined;
|
|
@@ -468,7 +468,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
468
468
|
}>;
|
|
469
469
|
};
|
|
470
470
|
userPwl: {
|
|
471
|
-
pwlUserLogin: (user: import("./types").User) => Promise<import("./types").ResponseSpec & {
|
|
471
|
+
pwlUserLogin: (user: import("./types").User, redirectTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
472
472
|
user: import("./types").User;
|
|
473
473
|
token?: string | undefined;
|
|
474
474
|
flowID?: string | undefined;
|
|
@@ -495,7 +495,7 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
495
495
|
pwlCreateUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
496
496
|
user: import("./types").User;
|
|
497
497
|
}>;
|
|
498
|
-
pwlLoginWithJWT: (
|
|
498
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<import("./types").ResponseSpec & {
|
|
499
499
|
user: import("./types").User;
|
|
500
500
|
token?: string | undefined;
|
|
501
501
|
flowID?: string | undefined;
|
package/esm/index.d.ts
CHANGED
|
@@ -917,7 +917,7 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
917
917
|
updateIntegration: (authToken: string, integrationID: string, integration: import("./types").Integration) => Promise<import("./types").ResponseSpec & {
|
|
918
918
|
integration: import("./types").Integration;
|
|
919
919
|
}>;
|
|
920
|
-
pwlUserLogin: (user: import("./types").User) => Promise<import("./types").ResponseSpec & {
|
|
920
|
+
pwlUserLogin: (user: import("./types").User, redirectTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
921
921
|
user: import("./types").User;
|
|
922
922
|
token?: string | undefined;
|
|
923
923
|
flowID?: string | undefined;
|
|
@@ -944,7 +944,7 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
944
944
|
pwlCreateUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
945
945
|
user: import("./types").User;
|
|
946
946
|
}>;
|
|
947
|
-
pwlLoginWithJWT: (
|
|
947
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<import("./types").ResponseSpec & {
|
|
948
948
|
user: import("./types").User;
|
|
949
949
|
token?: string | undefined;
|
|
950
950
|
flowID?: string | undefined;
|
|
@@ -1226,7 +1226,7 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1226
1226
|
}>;
|
|
1227
1227
|
};
|
|
1228
1228
|
userPwl: {
|
|
1229
|
-
pwlUserLogin: (user: import("./types").User) => Promise<import("./types").ResponseSpec & {
|
|
1229
|
+
pwlUserLogin: (user: import("./types").User, redirectTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
|
|
1230
1230
|
user: import("./types").User;
|
|
1231
1231
|
token?: string | undefined;
|
|
1232
1232
|
flowID?: string | undefined;
|
|
@@ -1253,7 +1253,7 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
1253
1253
|
pwlCreateUser: (authToken: string, user: Partial<import("./types").User>) => Promise<import("./types").ResponseSpec & {
|
|
1254
1254
|
user: import("./types").User;
|
|
1255
1255
|
}>;
|
|
1256
|
-
pwlLoginWithJWT: (
|
|
1256
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) => Promise<import("./types").ResponseSpec & {
|
|
1257
1257
|
user: import("./types").User;
|
|
1258
1258
|
token?: string | undefined;
|
|
1259
1259
|
flowID?: string | undefined;
|
package/package.json
CHANGED
package/src/backend/userPwl.ts
CHANGED
|
@@ -7,10 +7,10 @@ export default (apiUrl: string) => ({
|
|
|
7
7
|
* @param user - The user object
|
|
8
8
|
* @returns The logged in user object
|
|
9
9
|
*/
|
|
10
|
-
pwlUserLogin: (user: User) =>
|
|
10
|
+
pwlUserLogin: (user: User, redirectTo?: string) =>
|
|
11
11
|
apiFetcher('/PwlLogin', {
|
|
12
12
|
apiUrl,
|
|
13
|
-
body: user,
|
|
13
|
+
body: { ...user, redirectTo: redirectTo ?? '' },
|
|
14
14
|
method: 'POST',
|
|
15
15
|
}) as Promise<
|
|
16
16
|
ResponseSpec & { user: User; token?: string; flowID?: string }
|
|
@@ -140,16 +140,20 @@ export default (apiUrl: string) => ({
|
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
142
|
* Tries a login with the specified JWT and returns a login token if successful.
|
|
143
|
-
* @param {
|
|
144
|
-
* @param {string}
|
|
143
|
+
* @param {string} jwtToken - The JWT
|
|
144
|
+
* @param {string} tenant - The tenant ID
|
|
145
|
+
* @param {string} secretKey - The trusted app secret key
|
|
145
146
|
* @returns The logged in user object
|
|
146
147
|
*/
|
|
147
|
-
pwlLoginWithJWT: (
|
|
148
|
+
pwlLoginWithJWT: (jwtToken: string, tenant: string, secretKey: string) =>
|
|
148
149
|
apiFetcher('/LoginWithJWT', {
|
|
149
150
|
apiUrl,
|
|
150
|
-
body: {
|
|
151
|
+
body: { jwtToken, tenant },
|
|
152
|
+
headers: {
|
|
153
|
+
'X-Memori-Trusted-App': secretKey,
|
|
154
|
+
},
|
|
151
155
|
method: 'POST',
|
|
152
156
|
}) as Promise<
|
|
153
157
|
ResponseSpec & { user: User; token?: string; flowID?: string }
|
|
154
158
|
>,
|
|
155
|
-
});
|
|
159
|
+
});
|