@digitaldefiance/express-suite-react-components 2.9.9 → 2.9.11
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitaldefiance/express-suite-react-components",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.11",
|
|
4
4
|
"homepage": "https://github.com/Digital-Defiance/react-components",
|
|
5
5
|
"description": "React MUI components for Digital Defiance Express Suite",
|
|
6
6
|
"repository": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authService.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/services/authService.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,WAAW,EAEX,YAAY,EACZ,YAAY,EAEb,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"authService.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/services/authService.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,WAAW,EAEX,YAAY,EACZ,YAAY,EAEb,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEL,UAAU,EACV,eAAe,EAGhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAU5C,qBAAa,WAAW;IAOpB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;IAPjB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,sBAAsB,CAAsB;gBAG1C,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,MAAM,EACvB,WAAW,EAAE,YAAY;IAQ3B,aAAa,IAAI,MAAM;IAIjB,QAAQ,CACZ,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,QAA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K,WAAW,CACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IA8B7D,YAAY,IAAI,OAAO,CAAC;QAC5B,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,eAAe,CAAC;KACvB,CAAC;IA6BI,cAAc,CAClB,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IA4BlE,eAAe,CACnB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,OAAO,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CACN;QACE,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,eAAe,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GACD;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CACzD;CAiDF;AAED,eAAO,MAAM,iBAAiB,GAC5B,WAAW,UAAU,EACrB,SAAS,MAAM,EACf,aAAa,YAAY,gBAC0B,CAAC"}
|
|
@@ -88,11 +88,9 @@ class AuthService {
|
|
|
88
88
|
const loginRequest = await this.apiClient.post('/user/request-direct-login');
|
|
89
89
|
if (loginRequest.data.challenge) {
|
|
90
90
|
const { wallet } = this.cryptoCore.walletAndSeedFromMnemonic(mnemonic);
|
|
91
|
-
const
|
|
92
|
-
//
|
|
93
|
-
const publicKeyWithPrefix =
|
|
94
|
-
publicKeyWithPrefix[0] = 0x04;
|
|
95
|
-
publicKeyWithPrefix.set(publicKey, 1);
|
|
91
|
+
const privateKey = wallet.getPrivateKey();
|
|
92
|
+
// Get compressed public key (already includes prefix)
|
|
93
|
+
const publicKeyWithPrefix = this.cryptoCore.getPublicKey(privateKey);
|
|
96
94
|
const challengeBuffer = (0, ecies_lib_1.hexToUint8Array)(loginRequest.data.challenge);
|
|
97
95
|
const privateKeyBuffer = wallet.getPrivateKey();
|
|
98
96
|
const signature = this.eciesService.signMessage(privateKeyBuffer, challengeBuffer);
|
|
@@ -116,14 +114,16 @@ class AuthService {
|
|
|
116
114
|
catch (error) {
|
|
117
115
|
if ((0, axios_1.isAxiosError)(error) && error.response) {
|
|
118
116
|
// Check for DirectChallengeNotEnabled error
|
|
119
|
-
if (error.response.status === 403 &&
|
|
117
|
+
if (error.response.status === 403 &&
|
|
118
|
+
error.response.data.errorType === 'DirectChallengeNotEnabledError') {
|
|
120
119
|
return {
|
|
121
120
|
error: (0, suite_core_lib_1.getSuiteCoreTranslation)(suite_core_lib_1.SuiteCoreStringKey.Error_Login_DirectChallengeNotEnabled),
|
|
122
121
|
errorType: 'DirectChallengeNotEnabled',
|
|
123
122
|
};
|
|
124
123
|
}
|
|
125
124
|
// Check for PasswordLoginNotEnabled error
|
|
126
|
-
if (error.response.status === 403 &&
|
|
125
|
+
if (error.response.status === 403 &&
|
|
126
|
+
error.response.data.errorType === 'PasswordLoginNotEnabledError') {
|
|
127
127
|
return {
|
|
128
128
|
error: (0, suite_core_lib_1.getSuiteCoreTranslation)(suite_core_lib_1.SuiteCoreStringKey.Error_Login_PasswordLoginNotEnabled),
|
|
129
129
|
errorType: 'PasswordLoginNotEnabled',
|
|
@@ -295,7 +295,9 @@ class AuthService {
|
|
|
295
295
|
: {}),
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
|
-
return {
|
|
298
|
+
return {
|
|
299
|
+
error: (0, suite_core_lib_1.getSuiteCoreTranslation)(suite_core_lib_1.SuiteCoreStringKey.Common_UnexpectedError),
|
|
300
|
+
};
|
|
299
301
|
}
|
|
300
302
|
}
|
|
301
303
|
async backupCodeLogin(identifier, code, isEmail, recoverMnemonic, newPassword) {
|
|
@@ -311,7 +313,9 @@ class AuthService {
|
|
|
311
313
|
token: response.data.token,
|
|
312
314
|
user: response.data.user,
|
|
313
315
|
codeCount: response.data.codeCount ?? 0,
|
|
314
|
-
...(response.data.mnemonic
|
|
316
|
+
...(response.data.mnemonic
|
|
317
|
+
? { mnemonic: response.data.mnemonic }
|
|
318
|
+
: {}),
|
|
315
319
|
...(response.data.message ? { message: response.data.message } : {}),
|
|
316
320
|
};
|
|
317
321
|
}
|
|
@@ -338,7 +342,9 @@ class AuthService {
|
|
|
338
342
|
status: error.response.status,
|
|
339
343
|
};
|
|
340
344
|
}
|
|
341
|
-
return {
|
|
345
|
+
return {
|
|
346
|
+
error: (0, suite_core_lib_1.getSuiteCoreTranslation)(suite_core_lib_1.SuiteCoreStringKey.Common_UnexpectedError),
|
|
347
|
+
};
|
|
342
348
|
}
|
|
343
349
|
}
|
|
344
350
|
}
|