@digitaldefiance/express-suite-react-components 2.9.38 → 2.9.40
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 +5 -4
- package/src/auth/Private.d.ts +6 -0
- package/src/auth/Private.d.ts.map +1 -0
- package/src/auth/Private.js +14 -0
- package/src/auth/PrivateRoute.d.ts +8 -0
- package/src/auth/PrivateRoute.d.ts.map +1 -0
- package/src/auth/PrivateRoute.js +23 -0
- package/src/auth/UnAuth.d.ts +6 -0
- package/src/auth/UnAuth.d.ts.map +1 -0
- package/src/auth/UnAuth.js +14 -0
- package/src/auth/UnAuthRoute.d.ts +8 -0
- package/src/auth/UnAuthRoute.d.ts.map +1 -0
- package/src/auth/UnAuthRoute.js +22 -0
- package/src/auth/{index.ts → index.d.ts} +2 -1
- package/src/auth/index.d.ts.map +1 -0
- package/src/auth/index.js +10 -0
- package/src/components/ApiAccess.d.ts +16 -0
- package/src/components/ApiAccess.d.ts.map +1 -0
- package/src/components/ApiAccess.js +77 -0
- package/src/components/BackupCodeLoginForm.d.ts +43 -0
- package/src/components/BackupCodeLoginForm.d.ts.map +1 -0
- package/src/components/BackupCodeLoginForm.js +139 -0
- package/src/components/BackupCodesForm.d.ts +26 -0
- package/src/components/BackupCodesForm.d.ts.map +1 -0
- package/src/components/BackupCodesForm.js +120 -0
- package/src/components/ChangePasswordForm.d.ts +26 -0
- package/src/components/ChangePasswordForm.d.ts.map +1 -0
- package/src/components/ChangePasswordForm.js +78 -0
- package/src/components/ConfirmationDialog.d.ts +13 -0
- package/src/components/ConfirmationDialog.d.ts.map +1 -0
- package/src/components/ConfirmationDialog.js +10 -0
- package/src/components/CurrencyCodeSelector.d.ts +9 -0
- package/src/components/CurrencyCodeSelector.d.ts.map +1 -0
- package/src/components/CurrencyCodeSelector.js +31 -0
- package/src/components/CurrencyInput.d.ts +13 -0
- package/src/components/CurrencyInput.d.ts.map +1 -0
- package/src/components/CurrencyInput.js +22 -0
- package/src/components/DashboardPage.d.ts +8 -0
- package/src/components/DashboardPage.d.ts.map +1 -0
- package/src/components/DashboardPage.js +10 -0
- package/src/components/DropdownMenu.d.ts +9 -0
- package/src/components/DropdownMenu.d.ts.map +1 -0
- package/src/components/DropdownMenu.js +56 -0
- package/src/components/ExpirationSecondsSelector.d.ts +13 -0
- package/src/components/ExpirationSecondsSelector.d.ts.map +1 -0
- package/src/components/ExpirationSecondsSelector.js +32 -0
- package/src/components/Flag.d.ts +20 -0
- package/src/components/Flag.d.ts.map +1 -0
- package/src/components/Flag.js +43 -0
- package/src/components/ForgotPasswordForm.d.ts +18 -0
- package/src/components/ForgotPasswordForm.d.ts.map +1 -0
- package/src/components/ForgotPasswordForm.js +61 -0
- package/src/components/LoginForm.d.ts +44 -0
- package/src/components/LoginForm.d.ts.map +1 -0
- package/src/components/LoginForm.js +122 -0
- package/src/components/LogoutPage.d.ts +8 -0
- package/src/components/LogoutPage.d.ts.map +1 -0
- package/src/components/LogoutPage.js +16 -0
- package/src/components/RegisterForm.d.ts +56 -0
- package/src/components/RegisterForm.d.ts.map +1 -0
- package/src/components/RegisterForm.js +140 -0
- package/src/components/ResetPasswordForm.d.ts +23 -0
- package/src/components/ResetPasswordForm.d.ts.map +1 -0
- package/src/components/ResetPasswordForm.js +78 -0
- package/src/components/SideMenu.d.ts +8 -0
- package/src/components/SideMenu.d.ts.map +1 -0
- package/src/components/SideMenu.js +25 -0
- package/src/components/SideMenuListItem.d.ts +13 -0
- package/src/components/SideMenuListItem.d.ts.map +1 -0
- package/src/components/SideMenuListItem.js +44 -0
- package/src/components/TopMenu.d.ts +24 -0
- package/src/components/TopMenu.d.ts.map +1 -0
- package/src/components/TopMenu.js +35 -0
- package/src/components/TranslatedTitle.d.ts +7 -0
- package/src/components/TranslatedTitle.d.ts.map +1 -0
- package/src/components/TranslatedTitle.js +15 -0
- package/src/components/UserLanguageSelector.d.ts +4 -0
- package/src/components/UserLanguageSelector.d.ts.map +1 -0
- package/src/components/UserLanguageSelector.js +31 -0
- package/src/components/UserMenu.d.ts +4 -0
- package/src/components/UserMenu.d.ts.map +1 -0
- package/src/components/UserMenu.js +12 -0
- package/src/components/UserSettingsForm.d.ts +57 -0
- package/src/components/UserSettingsForm.d.ts.map +1 -0
- package/src/components/UserSettingsForm.js +126 -0
- package/src/components/VerifyEmailPage.d.ts +23 -0
- package/src/components/VerifyEmailPage.d.ts.map +1 -0
- package/src/components/VerifyEmailPage.js +70 -0
- package/src/components/{index.ts → index.d.ts} +1 -1
- package/src/components/index.d.ts.map +1 -0
- package/src/components/index.js +28 -0
- package/src/contexts/AuthProvider.d.ts +152 -0
- package/src/contexts/AuthProvider.d.ts.map +1 -0
- package/src/contexts/AuthProvider.js +502 -0
- package/src/contexts/I18nProvider.d.ts +16 -0
- package/src/contexts/I18nProvider.d.ts.map +1 -0
- package/src/contexts/I18nProvider.js +46 -0
- package/src/contexts/MenuContext.d.ts +20 -0
- package/src/contexts/MenuContext.d.ts.map +1 -0
- package/src/contexts/MenuContext.js +273 -0
- package/src/contexts/SuiteConfigProvider.d.ts +44 -0
- package/src/contexts/SuiteConfigProvider.d.ts.map +1 -0
- package/src/contexts/SuiteConfigProvider.js +43 -0
- package/src/contexts/ThemeProvider.d.ts +15 -0
- package/src/contexts/ThemeProvider.d.ts.map +1 -0
- package/src/contexts/ThemeProvider.js +36 -0
- package/src/contexts/{index.ts → index.d.ts} +1 -0
- package/src/contexts/index.d.ts.map +1 -0
- package/src/contexts/index.js +8 -0
- package/src/hooks/{index.ts → index.d.ts} +1 -0
- package/src/hooks/index.d.ts.map +1 -0
- package/src/hooks/index.js +8 -0
- package/src/hooks/useBackupCodes.d.ts +15 -0
- package/src/hooks/useBackupCodes.d.ts.map +1 -0
- package/src/hooks/useBackupCodes.js +74 -0
- package/src/hooks/useEmailVerification.d.ts +10 -0
- package/src/hooks/useEmailVerification.d.ts.map +1 -0
- package/src/hooks/useEmailVerification.js +40 -0
- package/src/hooks/useExpiringValue.d.ts +14 -0
- package/src/hooks/useExpiringValue.d.ts.map +1 -0
- package/src/hooks/useExpiringValue.js +53 -0
- package/src/hooks/useLocalStorage.d.ts +2 -0
- package/src/hooks/useLocalStorage.d.ts.map +1 -0
- package/src/hooks/useLocalStorage.js +15 -0
- package/src/hooks/useUserSettings.d.ts +48 -0
- package/src/hooks/useUserSettings.d.ts.map +1 -0
- package/src/hooks/useUserSettings.js +169 -0
- package/src/{index.ts → index.d.ts} +1 -1
- package/src/index.d.ts.map +1 -0
- package/src/index.js +12 -0
- package/src/interfaces/IAppConfig.d.ts +6 -0
- package/src/interfaces/IAppConfig.d.ts.map +1 -0
- package/src/interfaces/IAppConfig.js +2 -0
- package/src/interfaces/IMenuConfig.d.ts +11 -0
- package/src/interfaces/IMenuConfig.d.ts.map +1 -0
- package/src/interfaces/IMenuConfig.js +2 -0
- package/src/interfaces/IMenuOption.d.ts +58 -0
- package/src/interfaces/IMenuOption.d.ts.map +1 -0
- package/src/interfaces/IMenuOption.js +2 -0
- package/src/interfaces/index.d.ts +4 -0
- package/src/interfaces/index.d.ts.map +1 -0
- package/src/interfaces/index.js +6 -0
- package/src/services/__mocks__/authService.d.ts +21 -0
- package/src/services/__mocks__/authService.d.ts.map +1 -0
- package/src/services/__mocks__/authService.js +15 -0
- package/src/services/api.d.ts +3 -0
- package/src/services/api.d.ts.map +1 -0
- package/src/services/api.js +14 -0
- package/src/services/authService.d.ts +72 -0
- package/src/services/authService.d.ts.map +1 -0
- package/src/services/authService.js +335 -0
- package/src/services/authenticatedApi.d.ts +3 -0
- package/src/services/authenticatedApi.d.ts.map +1 -0
- package/src/services/authenticatedApi.js +18 -0
- package/src/services/index.d.ts +4 -0
- package/src/services/index.d.ts.map +1 -0
- package/src/services/index.js +6 -0
- package/src/types/MenuType.d.ts +11 -0
- package/src/types/MenuType.d.ts.map +1 -0
- package/src/types/MenuType.js +12 -0
- package/src/types/expirationSeconds.d.ts +3 -0
- package/src/types/expirationSeconds.d.ts.map +1 -0
- package/src/types/expirationSeconds.js +17 -0
- package/src/types/index.d.ts +2 -0
- package/src/types/index.d.ts.map +1 -0
- package/src/types/index.js +4 -0
- package/src/types/translation.d.ts +10 -0
- package/src/types/translation.d.ts.map +1 -0
- package/src/types/translation.js +9 -0
- package/src/wrappers/BackupCodeLoginWrapper.d.ts +8 -0
- package/src/wrappers/BackupCodeLoginWrapper.d.ts.map +1 -0
- package/src/wrappers/BackupCodeLoginWrapper.js +20 -0
- package/src/wrappers/BackupCodesWrapper.d.ts +7 -0
- package/src/wrappers/BackupCodesWrapper.d.ts.map +1 -0
- package/src/wrappers/BackupCodesWrapper.js +17 -0
- package/src/wrappers/ChangePasswordFormWrapper.d.ts +8 -0
- package/src/wrappers/ChangePasswordFormWrapper.d.ts.map +1 -0
- package/src/wrappers/ChangePasswordFormWrapper.js +21 -0
- package/src/wrappers/LoginFormWrapper.d.ts +9 -0
- package/src/wrappers/LoginFormWrapper.d.ts.map +1 -0
- package/src/wrappers/LoginFormWrapper.js +43 -0
- package/src/wrappers/LogoutPageWrapper.d.ts +9 -0
- package/src/wrappers/LogoutPageWrapper.d.ts.map +1 -0
- package/src/wrappers/LogoutPageWrapper.js +21 -0
- package/src/wrappers/RegisterFormWrapper.d.ts +9 -0
- package/src/wrappers/RegisterFormWrapper.d.ts.map +1 -0
- package/src/wrappers/RegisterFormWrapper.js +31 -0
- package/src/wrappers/UserSettingsFormWrapper.d.ts +8 -0
- package/src/wrappers/UserSettingsFormWrapper.d.ts.map +1 -0
- package/src/wrappers/UserSettingsFormWrapper.js +24 -0
- package/src/wrappers/VerifyEmailPageWrapper.d.ts +8 -0
- package/src/wrappers/VerifyEmailPageWrapper.d.ts.map +1 -0
- package/src/wrappers/VerifyEmailPageWrapper.js +20 -0
- package/src/wrappers/{index.tsx → index.d.ts} +1 -8
- package/src/wrappers/index.d.ts.map +1 -0
- package/src/wrappers/index.js +20 -0
- package/LICENSE +0 -21
- package/src/auth/Private.tsx +0 -17
- package/src/auth/PrivateRoute.tsx +0 -28
- package/src/auth/UnAuth.tsx +0 -16
- package/src/auth/UnAuthRoute.tsx +0 -30
- package/src/components/ApiAccess.tsx +0 -174
- package/src/components/BackupCodeLoginForm.tsx +0 -488
- package/src/components/BackupCodesForm.tsx +0 -286
- package/src/components/ChangePasswordForm.tsx +0 -272
- package/src/components/ConfirmationDialog.tsx +0 -48
- package/src/components/CurrencyCodeSelector.tsx +0 -60
- package/src/components/CurrencyInput.tsx +0 -80
- package/src/components/DashboardPage.tsx +0 -24
- package/src/components/DropdownMenu.tsx +0 -92
- package/src/components/ExpirationSecondsSelector.tsx +0 -60
- package/src/components/Flag.tsx +0 -52
- package/src/components/ForgotPasswordForm.tsx +0 -173
- package/src/components/LoginForm.tsx +0 -455
- package/src/components/LogoutPage.tsx +0 -21
- package/src/components/RegisterForm.tsx +0 -602
- package/src/components/ResetPasswordForm.tsx +0 -246
- package/src/components/SideMenu.tsx +0 -46
- package/src/components/SideMenuListItem.tsx +0 -74
- package/src/components/TopMenu.tsx +0 -145
- package/src/components/TranslatedTitle.tsx +0 -29
- package/src/components/UserLanguageSelector.tsx +0 -45
- package/src/components/UserMenu.tsx +0 -15
- package/src/components/UserSettingsForm.tsx +0 -505
- package/src/components/VerifyEmailPage.tsx +0 -184
- package/src/contexts/AuthProvider.spec.tsx +0 -1195
- package/src/contexts/AuthProvider.tsx +0 -924
- package/src/contexts/I18nProvider.tsx +0 -114
- package/src/contexts/MenuContext.tsx +0 -398
- package/src/contexts/SuiteConfigProvider.tsx +0 -93
- package/src/contexts/ThemeProvider.tsx +0 -67
- package/src/hooks/useBackupCodes.ts +0 -105
- package/src/hooks/useEmailVerification.ts +0 -49
- package/src/hooks/useExpiringValue.ts +0 -78
- package/src/hooks/useLocalStorage.ts +0 -18
- package/src/hooks/useUserSettings.ts +0 -269
- package/src/interfaces/IAppConfig.ts +0 -5
- package/src/interfaces/IMenuConfig.ts +0 -11
- package/src/interfaces/IMenuOption.ts +0 -55
- package/src/interfaces/index.ts +0 -3
- package/src/services/__mocks__/authService.ts +0 -14
- package/src/services/api.ts +0 -13
- package/src/services/authService.ts +0 -500
- package/src/services/authenticatedApi.ts +0 -17
- package/src/services/index.ts +0 -3
- package/src/types/MenuType.ts +0 -15
- package/src/types/expirationSeconds.ts +0 -18
- package/src/types/index.ts +0 -1
- package/src/types/translation.ts +0 -20
- package/src/wrappers/BackupCodeLoginWrapper.tsx +0 -34
- package/src/wrappers/BackupCodesWrapper.tsx +0 -28
- package/src/wrappers/ChangePasswordFormWrapper.tsx +0 -34
- package/src/wrappers/LoginFormWrapper.tsx +0 -59
- package/src/wrappers/LogoutPageWrapper.tsx +0 -30
- package/src/wrappers/RegisterFormWrapper.tsx +0 -61
- package/src/wrappers/UserSettingsFormWrapper.tsx +0 -39
- package/src/wrappers/VerifyEmailPageWrapper.tsx +0 -27
|
@@ -1,500 +0,0 @@
|
|
|
1
|
-
// services/authService.js
|
|
2
|
-
import {
|
|
3
|
-
EciesCryptoCore,
|
|
4
|
-
ECIESService,
|
|
5
|
-
EmailString,
|
|
6
|
-
hexToUint8Array,
|
|
7
|
-
IECIESConfig,
|
|
8
|
-
SecureString,
|
|
9
|
-
uint8ArrayToHex,
|
|
10
|
-
} from '@digitaldefiance/ecies-lib';
|
|
11
|
-
import {
|
|
12
|
-
getSuiteCoreTranslation,
|
|
13
|
-
IConstants,
|
|
14
|
-
IRequestUserDTO,
|
|
15
|
-
SuiteCoreStringKey,
|
|
16
|
-
TranslatableSuiteError,
|
|
17
|
-
} from '@digitaldefiance/suite-core-lib';
|
|
18
|
-
import { Wallet } from '@ethereumjs/wallet';
|
|
19
|
-
import axios, { isAxiosError } from 'axios';
|
|
20
|
-
import { createApiClient } from './api';
|
|
21
|
-
import { createAuthenticatedApiClient } from './authenticatedApi';
|
|
22
|
-
|
|
23
|
-
// API Response Types
|
|
24
|
-
interface ApiErrorResponse {
|
|
25
|
-
message?: string;
|
|
26
|
-
error?: string;
|
|
27
|
-
errorType?: string;
|
|
28
|
-
errors?: Array<{ path: string; msg: string }>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface RegisterResponse {
|
|
32
|
-
message: string;
|
|
33
|
-
mnemonic?: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface LoginResponse {
|
|
37
|
-
token: string;
|
|
38
|
-
user: IRequestUserDTO;
|
|
39
|
-
message?: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
interface ChallengeResponse {
|
|
43
|
-
challenge: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
interface BackupCodeLoginResponse {
|
|
47
|
-
token: string;
|
|
48
|
-
user: IRequestUserDTO;
|
|
49
|
-
codeCount: number;
|
|
50
|
-
mnemonic?: string;
|
|
51
|
-
message?: string;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export class AuthService {
|
|
55
|
-
private eciesService: ECIESService;
|
|
56
|
-
private cryptoCore: EciesCryptoCore;
|
|
57
|
-
private apiClient: axios.AxiosInstance;
|
|
58
|
-
private authenticatedApiClient: axios.AxiosInstance;
|
|
59
|
-
|
|
60
|
-
constructor(
|
|
61
|
-
private constants: IConstants,
|
|
62
|
-
private baseUrl: string,
|
|
63
|
-
eciesConfig: IECIESConfig
|
|
64
|
-
) {
|
|
65
|
-
this.eciesService = new ECIESService(eciesConfig);
|
|
66
|
-
this.cryptoCore = new EciesCryptoCore(eciesConfig);
|
|
67
|
-
this.apiClient = createApiClient(this.baseUrl);
|
|
68
|
-
this.authenticatedApiClient = createAuthenticatedApiClient(this.baseUrl);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
getSiteDomain(): string {
|
|
72
|
-
return this.constants.AdministratorEmail.split('@')[1];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async register(
|
|
76
|
-
username: string,
|
|
77
|
-
email: string,
|
|
78
|
-
timezone: string,
|
|
79
|
-
password?: string
|
|
80
|
-
): Promise<
|
|
81
|
-
| { success: boolean; message: string; mnemonic: string }
|
|
82
|
-
| {
|
|
83
|
-
error: string;
|
|
84
|
-
errorType?: string;
|
|
85
|
-
field?: string;
|
|
86
|
-
errors?: Array<Record<string, string>>;
|
|
87
|
-
}
|
|
88
|
-
> {
|
|
89
|
-
try {
|
|
90
|
-
const response = await this.apiClient.post<RegisterResponse>(
|
|
91
|
-
'/user/register',
|
|
92
|
-
{
|
|
93
|
-
username,
|
|
94
|
-
email,
|
|
95
|
-
timezone,
|
|
96
|
-
...(password ? { password } : {}),
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
if (response.status !== 201) {
|
|
100
|
-
const errorData = response.data as unknown as ApiErrorResponse;
|
|
101
|
-
return {
|
|
102
|
-
error: errorData.message
|
|
103
|
-
? errorData.message
|
|
104
|
-
: getSuiteCoreTranslation(SuiteCoreStringKey.Registration_Error),
|
|
105
|
-
...(errorData.errorType ? { errorType: errorData.errorType } : {}),
|
|
106
|
-
...(errorData.errors ? { errors: errorData.errors } : {}),
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
success: true,
|
|
111
|
-
message:
|
|
112
|
-
response.data.message ??
|
|
113
|
-
getSuiteCoreTranslation(SuiteCoreStringKey.Registration_Success, {
|
|
114
|
-
MNEMONIC: response.data.mnemonic,
|
|
115
|
-
}),
|
|
116
|
-
mnemonic: response.data.mnemonic ?? '',
|
|
117
|
-
};
|
|
118
|
-
} catch (error) {
|
|
119
|
-
if (isAxiosError<ApiErrorResponse>(error) && error.response) {
|
|
120
|
-
const errorData = error.response.data;
|
|
121
|
-
return {
|
|
122
|
-
error:
|
|
123
|
-
errorData.error ??
|
|
124
|
-
errorData.message ??
|
|
125
|
-
(error as Error).message ??
|
|
126
|
-
getSuiteCoreTranslation(SuiteCoreStringKey.Common_UnexpectedError),
|
|
127
|
-
...(errorData.errorType ? { errorType: errorData.errorType } : {}),
|
|
128
|
-
...(errorData.error ? { field: 'general' } : {}),
|
|
129
|
-
...(errorData.errors ? { errors: errorData.errors } : {}),
|
|
130
|
-
};
|
|
131
|
-
} else {
|
|
132
|
-
return {
|
|
133
|
-
error: getSuiteCoreTranslation(
|
|
134
|
-
SuiteCoreStringKey.Common_UnexpectedError
|
|
135
|
-
),
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
async directLogin(
|
|
142
|
-
mnemonic: SecureString,
|
|
143
|
-
username?: string,
|
|
144
|
-
email?: EmailString
|
|
145
|
-
): Promise<
|
|
146
|
-
| { token: string; user: IRequestUserDTO; wallet: Wallet; message: string }
|
|
147
|
-
| { error: string; errorType?: string }
|
|
148
|
-
> {
|
|
149
|
-
if (!username && !email) {
|
|
150
|
-
return {
|
|
151
|
-
error: getSuiteCoreTranslation(
|
|
152
|
-
SuiteCoreStringKey.Validation_UsernameOrEmailRequired
|
|
153
|
-
),
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
try {
|
|
157
|
-
const loginRequest = await this.apiClient.post<ChallengeResponse>(
|
|
158
|
-
'/user/request-direct-login'
|
|
159
|
-
);
|
|
160
|
-
if (loginRequest.data.challenge) {
|
|
161
|
-
const { wallet } = this.cryptoCore.walletAndSeedFromMnemonic(mnemonic);
|
|
162
|
-
const challengeBuffer = hexToUint8Array(loginRequest.data.challenge);
|
|
163
|
-
const privateKeyBuffer = wallet.getPrivateKey();
|
|
164
|
-
const signature = this.eciesService.signMessage(
|
|
165
|
-
privateKeyBuffer,
|
|
166
|
-
challengeBuffer
|
|
167
|
-
);
|
|
168
|
-
const signatureHex = uint8ArrayToHex(signature);
|
|
169
|
-
const loginResponse = await this.apiClient.post<LoginResponse>(
|
|
170
|
-
'/user/direct-challenge',
|
|
171
|
-
{
|
|
172
|
-
username: username,
|
|
173
|
-
email: email ? email.email : undefined,
|
|
174
|
-
challenge: loginRequest.data.challenge,
|
|
175
|
-
signature: signatureHex,
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
-
if (loginResponse.data.token && loginResponse.data.user) {
|
|
179
|
-
return {
|
|
180
|
-
message: loginResponse.data.message ?? '',
|
|
181
|
-
token: loginResponse.data.token,
|
|
182
|
-
user: loginResponse.data.user,
|
|
183
|
-
wallet,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
} catch (error) {
|
|
188
|
-
if (isAxiosError<ApiErrorResponse>(error) && error.response) {
|
|
189
|
-
// Check for DirectChallengeNotEnabled error
|
|
190
|
-
if (
|
|
191
|
-
error.response.status === 403 &&
|
|
192
|
-
error.response.data.errorType === 'DirectChallengeNotEnabledError'
|
|
193
|
-
) {
|
|
194
|
-
return {
|
|
195
|
-
error: getSuiteCoreTranslation(
|
|
196
|
-
SuiteCoreStringKey.Error_Login_DirectChallengeNotEnabled
|
|
197
|
-
),
|
|
198
|
-
errorType: 'DirectChallengeNotEnabled',
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
// Check for PasswordLoginNotEnabled error
|
|
202
|
-
if (
|
|
203
|
-
error.response.status === 403 &&
|
|
204
|
-
error.response.data.errorType === 'PasswordLoginNotEnabledError'
|
|
205
|
-
) {
|
|
206
|
-
return {
|
|
207
|
-
error: getSuiteCoreTranslation(
|
|
208
|
-
SuiteCoreStringKey.Error_Login_PasswordLoginNotEnabled
|
|
209
|
-
),
|
|
210
|
-
errorType: 'PasswordLoginNotEnabled',
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
const errorData = error.response.data;
|
|
215
|
-
return {
|
|
216
|
-
error:
|
|
217
|
-
errorData.error ??
|
|
218
|
-
errorData.message ??
|
|
219
|
-
(error as Error).message ??
|
|
220
|
-
getSuiteCoreTranslation(SuiteCoreStringKey.Common_UnexpectedError),
|
|
221
|
-
...(errorData.errorType ? { errorType: errorData.errorType } : {}),
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
console.error('directLogin: non-axios error:', error);
|
|
225
|
-
}
|
|
226
|
-
return {
|
|
227
|
-
error: getSuiteCoreTranslation(SuiteCoreStringKey.Common_UnexpectedError),
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
async requestEmailLogin(
|
|
232
|
-
username?: string,
|
|
233
|
-
email?: EmailString
|
|
234
|
-
): Promise<string | { error: string; errorType?: string }> {
|
|
235
|
-
if (!username && !email) {
|
|
236
|
-
return {
|
|
237
|
-
error: getSuiteCoreTranslation(
|
|
238
|
-
SuiteCoreStringKey.Validation_UsernameOrEmailRequired
|
|
239
|
-
),
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
try {
|
|
243
|
-
const result = await this.apiClient.post<{ message: string }>(
|
|
244
|
-
'/user/request-email-login',
|
|
245
|
-
{
|
|
246
|
-
email: email ? email.email : undefined,
|
|
247
|
-
username,
|
|
248
|
-
}
|
|
249
|
-
);
|
|
250
|
-
if (result.data.message) {
|
|
251
|
-
return result.data.message;
|
|
252
|
-
}
|
|
253
|
-
} catch (error) {
|
|
254
|
-
if (isAxiosError<ApiErrorResponse>(error) && error.response) {
|
|
255
|
-
const errorData = error.response.data;
|
|
256
|
-
return {
|
|
257
|
-
error:
|
|
258
|
-
errorData.error ??
|
|
259
|
-
errorData.message ??
|
|
260
|
-
(error as Error).message ??
|
|
261
|
-
getSuiteCoreTranslation(SuiteCoreStringKey.Common_UnexpectedError),
|
|
262
|
-
...(errorData.errorType ? { errorType: errorData.errorType } : {}),
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return {
|
|
267
|
-
error: getSuiteCoreTranslation(SuiteCoreStringKey.Common_UnexpectedError),
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
async emailChallengeLogin(
|
|
272
|
-
mnemonic: SecureString,
|
|
273
|
-
token: string,
|
|
274
|
-
username?: string,
|
|
275
|
-
email?: EmailString
|
|
276
|
-
): Promise<
|
|
277
|
-
| { token: string; user: IRequestUserDTO; wallet: Wallet; message: string }
|
|
278
|
-
| { error: string; errorType?: string }
|
|
279
|
-
> {
|
|
280
|
-
if (!username && !email) {
|
|
281
|
-
return {
|
|
282
|
-
error: getSuiteCoreTranslation(
|
|
283
|
-
SuiteCoreStringKey.Validation_UsernameOrEmailRequired
|
|
284
|
-
),
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
try {
|
|
288
|
-
const { wallet } = this.cryptoCore.walletAndSeedFromMnemonic(mnemonic);
|
|
289
|
-
const challengeBuffer = hexToUint8Array(token);
|
|
290
|
-
const privateKeyBuffer = wallet.getPrivateKey();
|
|
291
|
-
const signature = this.eciesService.signMessage(
|
|
292
|
-
privateKeyBuffer,
|
|
293
|
-
challengeBuffer
|
|
294
|
-
);
|
|
295
|
-
const signatureHex = uint8ArrayToHex(signature);
|
|
296
|
-
const response = await this.apiClient.post<LoginResponse>(
|
|
297
|
-
'/user/email-login',
|
|
298
|
-
{
|
|
299
|
-
token,
|
|
300
|
-
signature: signatureHex,
|
|
301
|
-
username: username ?? null,
|
|
302
|
-
email: email ?? null,
|
|
303
|
-
}
|
|
304
|
-
);
|
|
305
|
-
if (response.data.token && response.data.user) {
|
|
306
|
-
return {
|
|
307
|
-
message: response.data.message ?? '',
|
|
308
|
-
token: response.data.token,
|
|
309
|
-
user: response.data.user,
|
|
310
|
-
wallet,
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
} catch (error) {
|
|
314
|
-
if (isAxiosError<ApiErrorResponse>(error) && error.response) {
|
|
315
|
-
const errorData = error.response.data;
|
|
316
|
-
return {
|
|
317
|
-
error:
|
|
318
|
-
errorData.error ??
|
|
319
|
-
errorData.message ??
|
|
320
|
-
(error as Error).message ??
|
|
321
|
-
getSuiteCoreTranslation(SuiteCoreStringKey.Common_UnexpectedError),
|
|
322
|
-
...(errorData.errorType ? { errorType: errorData.errorType } : {}),
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
return {
|
|
327
|
-
error: getSuiteCoreTranslation(SuiteCoreStringKey.Common_UnexpectedError),
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
async verifyToken(
|
|
332
|
-
token: string
|
|
333
|
-
): Promise<IRequestUserDTO | { error: string; errorType?: string }> {
|
|
334
|
-
try {
|
|
335
|
-
const response = await this.apiClient.get<{ user: IRequestUserDTO }>(
|
|
336
|
-
'/user/verify',
|
|
337
|
-
{
|
|
338
|
-
headers: { Authorization: `Bearer ${token}` },
|
|
339
|
-
}
|
|
340
|
-
);
|
|
341
|
-
return response.data.user;
|
|
342
|
-
} catch (error) {
|
|
343
|
-
if (isAxiosError<ApiErrorResponse>(error) && error.response) {
|
|
344
|
-
const errorData = error.response.data;
|
|
345
|
-
return {
|
|
346
|
-
error: errorData.message
|
|
347
|
-
? errorData.message
|
|
348
|
-
: (error as Error).message
|
|
349
|
-
? (error as Error).message
|
|
350
|
-
: getSuiteCoreTranslation(
|
|
351
|
-
SuiteCoreStringKey.Common_UnexpectedError
|
|
352
|
-
),
|
|
353
|
-
...(errorData.errorType ? { errorType: errorData.errorType } : {}),
|
|
354
|
-
};
|
|
355
|
-
} else {
|
|
356
|
-
return {
|
|
357
|
-
error: getSuiteCoreTranslation(
|
|
358
|
-
SuiteCoreStringKey.Common_UnexpectedError
|
|
359
|
-
),
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
async refreshToken(): Promise<{
|
|
366
|
-
token: string;
|
|
367
|
-
user: IRequestUserDTO;
|
|
368
|
-
}> {
|
|
369
|
-
try {
|
|
370
|
-
const refreshResponse = await this.authenticatedApiClient.get<{
|
|
371
|
-
user: IRequestUserDTO;
|
|
372
|
-
}>('/user/refresh-token');
|
|
373
|
-
if (refreshResponse.status === 200) {
|
|
374
|
-
const newToken = refreshResponse.headers['authorization'] as
|
|
375
|
-
| string
|
|
376
|
-
| undefined;
|
|
377
|
-
let token: string | undefined = undefined;
|
|
378
|
-
let user: IRequestUserDTO | undefined = undefined;
|
|
379
|
-
if (
|
|
380
|
-
newToken &&
|
|
381
|
-
typeof newToken === 'string' &&
|
|
382
|
-
newToken.startsWith('Bearer ')
|
|
383
|
-
) {
|
|
384
|
-
token = newToken.slice(7);
|
|
385
|
-
}
|
|
386
|
-
if (refreshResponse.data.user) {
|
|
387
|
-
user = refreshResponse.data.user;
|
|
388
|
-
}
|
|
389
|
-
if (token && user) {
|
|
390
|
-
return { token, user };
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
} catch (error) {
|
|
394
|
-
console.error('Token refresh error:', error);
|
|
395
|
-
}
|
|
396
|
-
throw new TranslatableSuiteError(SuiteCoreStringKey.Common_UnexpectedError);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
async changePassword(
|
|
400
|
-
currentPassword: string,
|
|
401
|
-
newPassword: string
|
|
402
|
-
): Promise<{ success: boolean } | { error: string; errorType?: string }> {
|
|
403
|
-
try {
|
|
404
|
-
await this.authenticatedApiClient.post('/user/change-password', {
|
|
405
|
-
currentPassword,
|
|
406
|
-
newPassword,
|
|
407
|
-
});
|
|
408
|
-
return { success: true };
|
|
409
|
-
} catch (error) {
|
|
410
|
-
if (isAxiosError<ApiErrorResponse>(error) && error.response) {
|
|
411
|
-
const errorData = error.response.data;
|
|
412
|
-
return {
|
|
413
|
-
error:
|
|
414
|
-
errorData.error ??
|
|
415
|
-
errorData.message ??
|
|
416
|
-
(error as Error).message ??
|
|
417
|
-
getSuiteCoreTranslation(SuiteCoreStringKey.Common_UnexpectedError),
|
|
418
|
-
...(errorData.errorType ? { errorType: errorData.errorType } : {}),
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
return {
|
|
422
|
-
error: getSuiteCoreTranslation(
|
|
423
|
-
SuiteCoreStringKey.Common_UnexpectedError
|
|
424
|
-
),
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
async backupCodeLogin(
|
|
430
|
-
identifier: string,
|
|
431
|
-
code: string,
|
|
432
|
-
isEmail: boolean,
|
|
433
|
-
recoverMnemonic: boolean,
|
|
434
|
-
newPassword?: string
|
|
435
|
-
): Promise<
|
|
436
|
-
| {
|
|
437
|
-
token: string;
|
|
438
|
-
codeCount: number;
|
|
439
|
-
user?: IRequestUserDTO;
|
|
440
|
-
mnemonic?: string;
|
|
441
|
-
message?: string;
|
|
442
|
-
}
|
|
443
|
-
| { error: string; status?: number; errorType?: string }
|
|
444
|
-
> {
|
|
445
|
-
try {
|
|
446
|
-
const response = await this.apiClient.post<BackupCodeLoginResponse>(
|
|
447
|
-
'/user/backup-code',
|
|
448
|
-
{
|
|
449
|
-
[isEmail ? 'email' : 'username']: identifier,
|
|
450
|
-
code,
|
|
451
|
-
recoverMnemonic,
|
|
452
|
-
...(newPassword ? { newPassword } : {}),
|
|
453
|
-
}
|
|
454
|
-
);
|
|
455
|
-
if (response.data.token && response.data.user) {
|
|
456
|
-
return {
|
|
457
|
-
token: response.data.token,
|
|
458
|
-
user: response.data.user,
|
|
459
|
-
codeCount: response.data.codeCount ?? 0,
|
|
460
|
-
...(response.data.mnemonic
|
|
461
|
-
? { mnemonic: response.data.mnemonic }
|
|
462
|
-
: {}),
|
|
463
|
-
...(response.data.message ? { message: response.data.message } : {}),
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
const errorData = response.data as unknown as ApiErrorResponse;
|
|
467
|
-
return {
|
|
468
|
-
error: errorData.message
|
|
469
|
-
? errorData.message
|
|
470
|
-
: getSuiteCoreTranslation(SuiteCoreStringKey.Validation_InvalidToken),
|
|
471
|
-
...(errorData.errorType ? { errorType: errorData.errorType } : {}),
|
|
472
|
-
};
|
|
473
|
-
} catch (error) {
|
|
474
|
-
console.error('Backup code login error:', error);
|
|
475
|
-
if (isAxiosError<ApiErrorResponse>(error) && error.response) {
|
|
476
|
-
const errorData = error.response.data;
|
|
477
|
-
return {
|
|
478
|
-
error:
|
|
479
|
-
errorData.error ??
|
|
480
|
-
errorData.message ??
|
|
481
|
-
(error as Error).message ??
|
|
482
|
-
getSuiteCoreTranslation(SuiteCoreStringKey.Common_UnexpectedError),
|
|
483
|
-
...(errorData.errorType ? { errorType: errorData.errorType } : {}),
|
|
484
|
-
status: error.response.status,
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
return {
|
|
488
|
-
error: getSuiteCoreTranslation(
|
|
489
|
-
SuiteCoreStringKey.Common_UnexpectedError
|
|
490
|
-
),
|
|
491
|
-
};
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
export const createAuthService = (
|
|
497
|
-
constants: IConstants,
|
|
498
|
-
baseUrl: string,
|
|
499
|
-
eciesConfig: IECIESConfig
|
|
500
|
-
) => new AuthService(constants, baseUrl, eciesConfig);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
|
|
3
|
-
export function createAuthenticatedApiClient(baseURL: string, tokenKey: string = 'authToken') {
|
|
4
|
-
const api = axios.create({ baseURL });
|
|
5
|
-
|
|
6
|
-
api.interceptors.request.use((config) => {
|
|
7
|
-
const token = localStorage.getItem(tokenKey);
|
|
8
|
-
if (token) {
|
|
9
|
-
config.headers['Authorization'] = `Bearer ${token}`;
|
|
10
|
-
}
|
|
11
|
-
const languageCode = localStorage.getItem('languageCode') ?? 'en-US';
|
|
12
|
-
config.headers['Accept-Language'] = languageCode;
|
|
13
|
-
return config;
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
return api;
|
|
17
|
-
}
|
package/src/services/index.ts
DELETED
package/src/types/MenuType.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Branded type for menu type identifiers
|
|
2
|
-
export type MenuType = string & { readonly __brand: 'MenuType' };
|
|
3
|
-
|
|
4
|
-
// Factory function to create menu types
|
|
5
|
-
export const createMenuType = (id: string): MenuType => id as MenuType;
|
|
6
|
-
|
|
7
|
-
// Built-in menu types
|
|
8
|
-
export const MenuTypes = {
|
|
9
|
-
SideMenu: createMenuType('SideMenu'),
|
|
10
|
-
TopMenu: createMenuType('TopMenu'),
|
|
11
|
-
UserMenu: createMenuType('UserMenu'),
|
|
12
|
-
} as const;
|
|
13
|
-
|
|
14
|
-
// Type for the built-in menu types
|
|
15
|
-
export type BuiltInMenuType = typeof MenuTypes[keyof typeof MenuTypes];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export const ExpirationSecondsOptionValues = [0, 10, 30, 45, 60, 120, 300, 600];
|
|
2
|
-
|
|
3
|
-
export function createExpirationSecondsOptionNames(
|
|
4
|
-
secondsLabel: string,
|
|
5
|
-
minuteLabel: string,
|
|
6
|
-
minutesLabel: string
|
|
7
|
-
): string[] {
|
|
8
|
-
return [
|
|
9
|
-
`0 ${secondsLabel}`,
|
|
10
|
-
`10 ${secondsLabel}`,
|
|
11
|
-
`30 ${secondsLabel}`,
|
|
12
|
-
`45 ${secondsLabel}`,
|
|
13
|
-
`1 ${minuteLabel}`,
|
|
14
|
-
`2 ${minutesLabel}`,
|
|
15
|
-
`5 ${minutesLabel}`,
|
|
16
|
-
`10 ${minutesLabel}`,
|
|
17
|
-
];
|
|
18
|
-
}
|
package/src/types/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './MenuType';
|
package/src/types/translation.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Translation function type for components
|
|
3
|
-
* Accepts a key and optional variables, returns translated string
|
|
4
|
-
*/
|
|
5
|
-
export type TranslationFunction = (
|
|
6
|
-
key: string,
|
|
7
|
-
variables?: Record<string, string | number>
|
|
8
|
-
) => string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Helper to get translated text or fallback to provided string
|
|
12
|
-
*/
|
|
13
|
-
export function getTranslatedText(
|
|
14
|
-
t: TranslationFunction | undefined,
|
|
15
|
-
key: string,
|
|
16
|
-
fallback: string,
|
|
17
|
-
variables?: Record<string, string | number>
|
|
18
|
-
): string {
|
|
19
|
-
return t ? t(key, variables) : fallback;
|
|
20
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
import { BackupCodeLoginForm } from '../components/BackupCodeLoginForm';
|
|
4
|
-
import { useAuth } from '../contexts';
|
|
5
|
-
|
|
6
|
-
export interface BackupCodeLoginWrapperProps {
|
|
7
|
-
onSuccess?: () => void;
|
|
8
|
-
componentProps?: Partial<React.ComponentProps<typeof BackupCodeLoginForm>>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const BackupCodeLoginWrapper: FC<BackupCodeLoginWrapperProps> = ({
|
|
12
|
-
onSuccess,
|
|
13
|
-
componentProps = {},
|
|
14
|
-
}) => {
|
|
15
|
-
const { backupCodeLogin, isAuthenticated } = useAuth();
|
|
16
|
-
const navigate = useNavigate();
|
|
17
|
-
|
|
18
|
-
const handleSubmit: typeof backupCodeLogin = async (...args) => {
|
|
19
|
-
const result = await backupCodeLogin(...args);
|
|
20
|
-
if ('token' in result && onSuccess) {
|
|
21
|
-
onSuccess();
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<BackupCodeLoginForm
|
|
28
|
-
onSubmit={handleSubmit}
|
|
29
|
-
onNavigate={navigate}
|
|
30
|
-
isAuthenticated={isAuthenticated}
|
|
31
|
-
{...componentProps}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { useLocation } from 'react-router-dom';
|
|
3
|
-
import { BackupCodesForm } from '../components/BackupCodesForm';
|
|
4
|
-
import { useBackupCodes } from '../hooks';
|
|
5
|
-
|
|
6
|
-
export interface BackupCodesWrapperProps {
|
|
7
|
-
componentProps?: Partial<React.ComponentProps<typeof BackupCodesForm>>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const BackupCodesWrapper: FC<BackupCodesWrapperProps> = ({
|
|
11
|
-
componentProps = {},
|
|
12
|
-
}) => {
|
|
13
|
-
const location = useLocation();
|
|
14
|
-
const initialCodeCount = (location.state as { codeCount?: number })?.codeCount ?? null;
|
|
15
|
-
const { backupCodesRemaining, generateBackupCodes } = useBackupCodes({ initialCodeCount });
|
|
16
|
-
|
|
17
|
-
const handleSubmit = async (values: { password?: string; mnemonic?: string }) => {
|
|
18
|
-
return await generateBackupCodes(values.password, values.mnemonic);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<BackupCodesForm
|
|
23
|
-
onSubmit={handleSubmit}
|
|
24
|
-
backupCodesRemaining={backupCodesRemaining}
|
|
25
|
-
{...componentProps}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChangePasswordForm } from '../components/ChangePasswordForm';
|
|
3
|
-
import { useAuth } from '../contexts';
|
|
4
|
-
|
|
5
|
-
export interface ChangePasswordFormWrapperProps {
|
|
6
|
-
onSuccess?: () => void;
|
|
7
|
-
componentProps?: Partial<React.ComponentProps<typeof ChangePasswordForm>>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const ChangePasswordFormWrapper: FC<ChangePasswordFormWrapperProps> = ({
|
|
11
|
-
onSuccess,
|
|
12
|
-
componentProps = {},
|
|
13
|
-
}) => {
|
|
14
|
-
const { changePassword } = useAuth();
|
|
15
|
-
|
|
16
|
-
const handleSubmit = async (values: {
|
|
17
|
-
currentPassword: string;
|
|
18
|
-
newPassword: string;
|
|
19
|
-
}) => {
|
|
20
|
-
const result = await changePassword(
|
|
21
|
-
values.currentPassword,
|
|
22
|
-
values.newPassword
|
|
23
|
-
);
|
|
24
|
-
if ('error' in result) {
|
|
25
|
-
throw new Error(result.error);
|
|
26
|
-
}
|
|
27
|
-
if (onSuccess) {
|
|
28
|
-
onSuccess();
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
return <ChangePasswordForm onSubmit={handleSubmit} {...componentProps} />;
|
|
34
|
-
};
|