@opencrvs/mosip 1.7.0-alpha.11 → 1.7.0-alpha.12
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/build/forms.d.ts +4 -4
- package/build/forms.js +6 -6
- package/package.json +1 -1
- package/src/forms.ts +6 -10
package/build/forms.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @description E-Signet REDIRECT button form definition. Calls E-Signet /authorize (this field may not be supported in the latest release of OpenCRVS yet)
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
|
-
export declare const esignet: (
|
|
16
|
+
export declare const esignet: (esignetAuthUrl: string, openIdProviderClientId: string, openIdProviderClaims: string | undefined, fieldName: string, callbackFieldName: string) => {
|
|
17
17
|
name: string;
|
|
18
18
|
validator: never[];
|
|
19
19
|
icon: {
|
|
@@ -50,14 +50,14 @@ export declare const popupButton: ({ url, }: {
|
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
*
|
|
53
|
-
* @description esignet callback button form definition. Calls mosip-api/esignet
|
|
53
|
+
* @description esignet callback button form definition. Calls https://mosip-api.{{hostname}}/esignet/get-oidp-user-info
|
|
54
54
|
*
|
|
55
55
|
*/
|
|
56
|
-
export declare const esignetCallback: ({ fieldName,
|
|
56
|
+
export declare const esignetCallback: ({ fieldName, mosipAPIUserInfoUrl, openIdProviderClientId, }: {
|
|
57
57
|
fieldName: string;
|
|
58
58
|
event: string;
|
|
59
59
|
sectionId: string;
|
|
60
|
-
|
|
60
|
+
mosipAPIUserInfoUrl: string;
|
|
61
61
|
openIdProviderClientId: string;
|
|
62
62
|
}) => {
|
|
63
63
|
name: string;
|
package/build/forms.js
CHANGED
|
@@ -17,7 +17,7 @@ exports.idVerificationFields = exports.idPendingVerificationBanner = exports.ver
|
|
|
17
17
|
* @description E-Signet REDIRECT button form definition. Calls E-Signet /authorize (this field may not be supported in the latest release of OpenCRVS yet)
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
|
-
const esignet = (
|
|
20
|
+
const esignet = (esignetAuthUrl, openIdProviderClientId, openIdProviderClaims = "name,family_name,given_name,middle_name,birthdate,address", fieldName, callbackFieldName) => {
|
|
21
21
|
const url = new URL(esignetAuthUrl);
|
|
22
22
|
url.searchParams.append("client_id", openIdProviderClientId || "mock-client_id");
|
|
23
23
|
url.searchParams.append("response_type", "code");
|
|
@@ -25,7 +25,7 @@ const esignet = (event, sectionId, esignetAuthUrl, openIdProviderClientId, openI
|
|
|
25
25
|
url.searchParams.append("acr_values", "mosip:idp:acr:static-code");
|
|
26
26
|
url.searchParams.append("claims", openIdProviderClaims);
|
|
27
27
|
url.searchParams.append("state", "fetch-on-mount");
|
|
28
|
-
url.searchParams.append("redirect_uri", '${window.location.
|
|
28
|
+
url.searchParams.append("redirect_uri", '${window.location.href}');
|
|
29
29
|
return {
|
|
30
30
|
name: fieldName,
|
|
31
31
|
validator: [],
|
|
@@ -70,10 +70,10 @@ url, }) => {
|
|
|
70
70
|
exports.popupButton = popupButton;
|
|
71
71
|
/**
|
|
72
72
|
*
|
|
73
|
-
* @description esignet callback button form definition. Calls mosip-api/esignet
|
|
73
|
+
* @description esignet callback button form definition. Calls https://mosip-api.{{hostname}}/esignet/get-oidp-user-info
|
|
74
74
|
*
|
|
75
75
|
*/
|
|
76
|
-
const esignetCallback = ({ fieldName,
|
|
76
|
+
const esignetCallback = ({ fieldName, mosipAPIUserInfoUrl, openIdProviderClientId, }) => ({
|
|
77
77
|
name: fieldName,
|
|
78
78
|
type: "HTTP",
|
|
79
79
|
custom: true,
|
|
@@ -84,13 +84,13 @@ const esignetCallback = ({ fieldName, event, sectionId, getOIDPUserInfoUrl, open
|
|
|
84
84
|
validator: [],
|
|
85
85
|
hideInPreview: true,
|
|
86
86
|
options: {
|
|
87
|
-
url:
|
|
87
|
+
url: mosipAPIUserInfoUrl,
|
|
88
88
|
headers: {
|
|
89
89
|
"Content-type": "application/json",
|
|
90
90
|
},
|
|
91
91
|
body: {
|
|
92
92
|
clientId: openIdProviderClientId,
|
|
93
|
-
redirectUri: '${window.location.
|
|
93
|
+
redirectUri: '${window.location.href}',
|
|
94
94
|
},
|
|
95
95
|
method: "POST",
|
|
96
96
|
},
|
package/package.json
CHANGED
package/src/forms.ts
CHANGED
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
export const esignet = (
|
|
20
|
-
event: string,
|
|
21
|
-
sectionId: string,
|
|
22
20
|
esignetAuthUrl: string,
|
|
23
21
|
openIdProviderClientId: string,
|
|
24
22
|
openIdProviderClaims: string = "name,family_name,given_name,middle_name,birthdate,address",
|
|
@@ -38,7 +36,7 @@ export const esignet = (
|
|
|
38
36
|
url.searchParams.append("state", "fetch-on-mount");
|
|
39
37
|
url.searchParams.append(
|
|
40
38
|
"redirect_uri",
|
|
41
|
-
'${window.location.
|
|
39
|
+
'${window.location.href}',
|
|
42
40
|
);
|
|
43
41
|
|
|
44
42
|
return {
|
|
@@ -88,21 +86,19 @@ export const popupButton = ({
|
|
|
88
86
|
|
|
89
87
|
/**
|
|
90
88
|
*
|
|
91
|
-
* @description esignet callback button form definition. Calls mosip-api/esignet
|
|
89
|
+
* @description esignet callback button form definition. Calls https://mosip-api.{{hostname}}/esignet/get-oidp-user-info
|
|
92
90
|
*
|
|
93
91
|
*/
|
|
94
92
|
|
|
95
93
|
export const esignetCallback = ({
|
|
96
94
|
fieldName,
|
|
97
|
-
|
|
98
|
-
sectionId,
|
|
99
|
-
getOIDPUserInfoUrl,
|
|
95
|
+
mosipAPIUserInfoUrl,
|
|
100
96
|
openIdProviderClientId,
|
|
101
97
|
}: {
|
|
102
98
|
fieldName: string;
|
|
103
99
|
event: string;
|
|
104
100
|
sectionId: string;
|
|
105
|
-
|
|
101
|
+
mosipAPIUserInfoUrl: string;
|
|
106
102
|
openIdProviderClientId: string;
|
|
107
103
|
}) => ({
|
|
108
104
|
name: fieldName,
|
|
@@ -115,14 +111,14 @@ export const esignetCallback = ({
|
|
|
115
111
|
validator: [],
|
|
116
112
|
hideInPreview: true,
|
|
117
113
|
options: {
|
|
118
|
-
url:
|
|
114
|
+
url: mosipAPIUserInfoUrl,
|
|
119
115
|
headers: {
|
|
120
116
|
"Content-type": "application/json",
|
|
121
117
|
},
|
|
122
118
|
body: {
|
|
123
119
|
clientId: openIdProviderClientId,
|
|
124
120
|
redirectUri:
|
|
125
|
-
'${window.location.
|
|
121
|
+
'${window.location.href}',
|
|
126
122
|
},
|
|
127
123
|
|
|
128
124
|
method: "POST",
|