@abpjs/account 0.9.0 → 1.1.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/dist/components/AuthWrapper/AuthWrapper.d.ts +40 -0
- package/dist/components/AuthWrapper/index.d.ts +1 -0
- package/dist/components/ChangePasswordForm/ChangePasswordForm.d.ts +31 -0
- package/dist/components/ChangePasswordForm/index.d.ts +1 -0
- package/dist/components/ManageProfile/ManageProfile.d.ts +46 -0
- package/dist/components/ManageProfile/index.d.ts +1 -0
- package/dist/components/PersonalSettingsForm/PersonalSettingsForm.d.ts +31 -0
- package/dist/components/PersonalSettingsForm/index.d.ts +1 -0
- package/dist/components/index.d.ts +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +510 -143
- package/dist/index.mjs +500 -137
- package/dist/routes/index.d.ts +1 -0
- package/package.json +20 -6
package/dist/index.mjs
CHANGED
|
@@ -175,23 +175,180 @@ function useAccountService() {
|
|
|
175
175
|
return useMemo2(() => new AccountService(restService), [restService]);
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
// src/components/AuthWrapper/AuthWrapper.tsx
|
|
179
|
+
import { Box, Container, Stack, Flex } from "@chakra-ui/react";
|
|
180
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
181
|
+
function AuthWrapper({
|
|
182
|
+
children,
|
|
183
|
+
mainContent,
|
|
184
|
+
cancelContent
|
|
185
|
+
}) {
|
|
186
|
+
return /* @__PURE__ */ jsx2(Flex, { height: "full", flex: "1", className: "auth-wrapper", children: /* @__PURE__ */ jsx2(Box, { flex: "1", py: { base: "24", md: "32" }, children: /* @__PURE__ */ jsx2(Container, { maxW: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "8", children: [
|
|
187
|
+
mainContent || children,
|
|
188
|
+
cancelContent && /* @__PURE__ */ jsx2(Box, { textAlign: "center", mt: 4, children: cancelContent })
|
|
189
|
+
] }) }) }) });
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// src/components/ChangePasswordForm/ChangePasswordForm.tsx
|
|
193
|
+
import { useState as useState2, useEffect } from "react";
|
|
194
|
+
import { useForm } from "react-hook-form";
|
|
195
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
196
|
+
import { z } from "zod";
|
|
197
|
+
import { useLocalization, useProfile } from "@abpjs/core";
|
|
198
|
+
import { Button, useToaster } from "@abpjs/theme-shared";
|
|
199
|
+
import { Input, Stack as Stack2 } from "@chakra-ui/react";
|
|
200
|
+
import { Field, InputGroup } from "@chakra-ui/react";
|
|
201
|
+
import { LuLock } from "react-icons/lu";
|
|
202
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
203
|
+
var passwordValidation = {
|
|
204
|
+
hasLowercase: /[a-z]/,
|
|
205
|
+
hasUppercase: /[A-Z]/,
|
|
206
|
+
hasNumber: /[0-9]/,
|
|
207
|
+
hasSpecial: /[!@#$%^&*(),.?":{}|<>]/
|
|
208
|
+
};
|
|
209
|
+
var changePasswordSchema = z.object({
|
|
210
|
+
currentPassword: z.string().min(1, "Current password is required"),
|
|
211
|
+
newPassword: z.string().min(6, "Password must be at least 6 characters").max(32, "Password must be at most 32 characters").refine(
|
|
212
|
+
(val) => passwordValidation.hasLowercase.test(val),
|
|
213
|
+
"Password must contain at least one lowercase letter"
|
|
214
|
+
).refine(
|
|
215
|
+
(val) => passwordValidation.hasUppercase.test(val),
|
|
216
|
+
"Password must contain at least one uppercase letter"
|
|
217
|
+
).refine(
|
|
218
|
+
(val) => passwordValidation.hasNumber.test(val),
|
|
219
|
+
"Password must contain at least one number"
|
|
220
|
+
).refine(
|
|
221
|
+
(val) => passwordValidation.hasSpecial.test(val),
|
|
222
|
+
"Password must contain at least one special character"
|
|
223
|
+
),
|
|
224
|
+
confirmNewPassword: z.string().min(1, "Confirm password is required")
|
|
225
|
+
}).refine((data) => data.newPassword === data.confirmNewPassword, {
|
|
226
|
+
message: "Passwords do not match",
|
|
227
|
+
path: ["confirmNewPassword"]
|
|
228
|
+
});
|
|
229
|
+
function ChangePasswordForm({ onSuccess, onError }) {
|
|
230
|
+
const { t } = useLocalization();
|
|
231
|
+
const { changePassword } = useProfile();
|
|
232
|
+
const toaster = useToaster();
|
|
233
|
+
const [inProgress, setInProgress] = useState2(false);
|
|
234
|
+
const {
|
|
235
|
+
register,
|
|
236
|
+
handleSubmit,
|
|
237
|
+
reset,
|
|
238
|
+
formState: { errors }
|
|
239
|
+
} = useForm({
|
|
240
|
+
resolver: zodResolver(changePasswordSchema),
|
|
241
|
+
defaultValues: {
|
|
242
|
+
currentPassword: "",
|
|
243
|
+
newPassword: "",
|
|
244
|
+
confirmNewPassword: ""
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
useEffect(() => {
|
|
248
|
+
}, []);
|
|
249
|
+
const onSubmit = async (data) => {
|
|
250
|
+
setInProgress(true);
|
|
251
|
+
try {
|
|
252
|
+
await changePassword({
|
|
253
|
+
currentPassword: data.currentPassword,
|
|
254
|
+
newPassword: data.newPassword
|
|
255
|
+
});
|
|
256
|
+
toaster.success(
|
|
257
|
+
t("AbpAccount::PasswordChangedMessage") || "Your password has been changed successfully.",
|
|
258
|
+
t("AbpAccount::Success") || "Success"
|
|
259
|
+
);
|
|
260
|
+
reset();
|
|
261
|
+
onSuccess?.();
|
|
262
|
+
} catch (err) {
|
|
263
|
+
const errorMessage = err?.error?.error_description || err?.error?.error?.message || t("AbpAccount::DefaultErrorMessage") || "An error occurred";
|
|
264
|
+
toaster.error(errorMessage, t("AbpUi::Error") || "Error", { life: 7e3 });
|
|
265
|
+
onError?.(errorMessage);
|
|
266
|
+
} finally {
|
|
267
|
+
setInProgress(false);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
return /* @__PURE__ */ jsx3("form", { onSubmit: handleSubmit(onSubmit), noValidate: true, children: /* @__PURE__ */ jsxs2(Stack2, { gap: "5", children: [
|
|
271
|
+
/* @__PURE__ */ jsxs2(Field.Root, { invalid: !!errors.currentPassword, children: [
|
|
272
|
+
/* @__PURE__ */ jsx3(Field.Label, { children: t("AbpAccount::CurrentPassword") }),
|
|
273
|
+
/* @__PURE__ */ jsx3(InputGroup, { startElement: /* @__PURE__ */ jsx3(LuLock, {}), width: "full", children: /* @__PURE__ */ jsx3(
|
|
274
|
+
Input,
|
|
275
|
+
{
|
|
276
|
+
id: "current-password",
|
|
277
|
+
type: "password",
|
|
278
|
+
autoComplete: "current-password",
|
|
279
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
280
|
+
...register("currentPassword")
|
|
281
|
+
}
|
|
282
|
+
) }),
|
|
283
|
+
errors.currentPassword && /* @__PURE__ */ jsx3(Field.ErrorText, { children: errors.currentPassword.message })
|
|
284
|
+
] }),
|
|
285
|
+
/* @__PURE__ */ jsxs2(Field.Root, { invalid: !!errors.newPassword, children: [
|
|
286
|
+
/* @__PURE__ */ jsx3(Field.Label, { children: t("AbpAccount::NewPassword") }),
|
|
287
|
+
/* @__PURE__ */ jsx3(InputGroup, { startElement: /* @__PURE__ */ jsx3(LuLock, {}), width: "full", children: /* @__PURE__ */ jsx3(
|
|
288
|
+
Input,
|
|
289
|
+
{
|
|
290
|
+
id: "new-password",
|
|
291
|
+
type: "password",
|
|
292
|
+
autoComplete: "new-password",
|
|
293
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
294
|
+
...register("newPassword")
|
|
295
|
+
}
|
|
296
|
+
) }),
|
|
297
|
+
errors.newPassword && /* @__PURE__ */ jsx3(Field.ErrorText, { children: errors.newPassword.message })
|
|
298
|
+
] }),
|
|
299
|
+
/* @__PURE__ */ jsxs2(Field.Root, { invalid: !!errors.confirmNewPassword, children: [
|
|
300
|
+
/* @__PURE__ */ jsx3(Field.Label, { children: t("AbpAccount::NewPasswordConfirm") }),
|
|
301
|
+
/* @__PURE__ */ jsx3(InputGroup, { startElement: /* @__PURE__ */ jsx3(LuLock, {}), width: "full", children: /* @__PURE__ */ jsx3(
|
|
302
|
+
Input,
|
|
303
|
+
{
|
|
304
|
+
id: "confirm-new-password",
|
|
305
|
+
type: "password",
|
|
306
|
+
autoComplete: "new-password",
|
|
307
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
308
|
+
...register("confirmNewPassword")
|
|
309
|
+
}
|
|
310
|
+
) }),
|
|
311
|
+
errors.confirmNewPassword && /* @__PURE__ */ jsx3(Field.ErrorText, { children: errors.confirmNewPassword.message })
|
|
312
|
+
] }),
|
|
313
|
+
/* @__PURE__ */ jsx3(
|
|
314
|
+
Button,
|
|
315
|
+
{
|
|
316
|
+
type: "submit",
|
|
317
|
+
colorPalette: "blue",
|
|
318
|
+
loading: inProgress,
|
|
319
|
+
loadingText: t("AbpAccount::Submit"),
|
|
320
|
+
children: t("AbpAccount::Submit")
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
] }) });
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// src/components/LoginForm/LoginForm.tsx
|
|
327
|
+
import { useForm as useForm2 } from "react-hook-form";
|
|
328
|
+
import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
|
|
329
|
+
import { z as z2 } from "zod";
|
|
330
|
+
import { Link as RouterLink } from "react-router-dom";
|
|
331
|
+
import { useLocalization as useLocalization3 } from "@abpjs/core";
|
|
332
|
+
import { Alert, Button as Button3, Checkbox } from "@abpjs/theme-shared";
|
|
333
|
+
import { Box as Box3, Heading, Input as Input3, Link as Link2, HStack, Show } from "@chakra-ui/react";
|
|
334
|
+
|
|
178
335
|
// src/components/TenantBox/TenantBox.tsx
|
|
179
|
-
import { useState as
|
|
336
|
+
import { useState as useState3, useCallback as useCallback2, useEffect as useEffect2 } from "react";
|
|
180
337
|
import { useDispatch, useSelector } from "react-redux";
|
|
181
|
-
import { useLocalization, sessionActions, selectTenant } from "@abpjs/core";
|
|
182
|
-
import { Modal, Button, useToaster } from "@abpjs/theme-shared";
|
|
183
|
-
import { Box, Text, Link, Input, VStack } from "@chakra-ui/react";
|
|
184
|
-
import { Fragment, jsx as
|
|
338
|
+
import { useLocalization as useLocalization2, sessionActions, selectTenant } from "@abpjs/core";
|
|
339
|
+
import { Modal, Button as Button2, useToaster as useToaster2 } from "@abpjs/theme-shared";
|
|
340
|
+
import { Box as Box2, Text, Link, Input as Input2, VStack } from "@chakra-ui/react";
|
|
341
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
185
342
|
function TenantBox({ containerStyle }) {
|
|
186
|
-
const { t } =
|
|
343
|
+
const { t } = useLocalization2();
|
|
187
344
|
const dispatch = useDispatch();
|
|
188
345
|
const accountService = useAccountService();
|
|
189
|
-
const toaster =
|
|
346
|
+
const toaster = useToaster2();
|
|
190
347
|
const currentTenant = useSelector(selectTenant);
|
|
191
|
-
const [tenantName, setTenantName] =
|
|
192
|
-
const [isModalVisible, setIsModalVisible] =
|
|
193
|
-
const [
|
|
194
|
-
|
|
348
|
+
const [tenantName, setTenantName] = useState3("");
|
|
349
|
+
const [isModalVisible, setIsModalVisible] = useState3(false);
|
|
350
|
+
const [inProgress, setInProgress] = useState3(false);
|
|
351
|
+
useEffect2(() => {
|
|
195
352
|
setTenantName(currentTenant?.name || "");
|
|
196
353
|
}, [currentTenant]);
|
|
197
354
|
const onSwitch = useCallback2(() => {
|
|
@@ -199,7 +356,7 @@ function TenantBox({ containerStyle }) {
|
|
|
199
356
|
}, []);
|
|
200
357
|
const save = useCallback2(async () => {
|
|
201
358
|
if (tenantName) {
|
|
202
|
-
|
|
359
|
+
setInProgress(true);
|
|
203
360
|
try {
|
|
204
361
|
const { success, tenantId } = await accountService.findTenant(tenantName);
|
|
205
362
|
if (success) {
|
|
@@ -220,7 +377,7 @@ function TenantBox({ containerStyle }) {
|
|
|
220
377
|
const errorMessage = err?.error?.error_description || err?.error?.error?.message || t("AbpUi::DefaultErrorMessage") || "An error occurred";
|
|
221
378
|
toaster.error(errorMessage, t("AbpUi::Error") || "Error");
|
|
222
379
|
} finally {
|
|
223
|
-
|
|
380
|
+
setInProgress(false);
|
|
224
381
|
}
|
|
225
382
|
} else {
|
|
226
383
|
dispatch(sessionActions.setTenant({ id: "", name: "" }));
|
|
@@ -238,9 +395,9 @@ function TenantBox({ containerStyle }) {
|
|
|
238
395
|
},
|
|
239
396
|
[save]
|
|
240
397
|
);
|
|
241
|
-
return /* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
|
|
398
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
399
|
+
/* @__PURE__ */ jsxs3(
|
|
400
|
+
Box2,
|
|
244
401
|
{
|
|
245
402
|
className: "tenant-switch-box",
|
|
246
403
|
bg: "gray.100",
|
|
@@ -251,14 +408,14 @@ function TenantBox({ containerStyle }) {
|
|
|
251
408
|
borderRadius: "md",
|
|
252
409
|
style: containerStyle,
|
|
253
410
|
children: [
|
|
254
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ jsxs3(Text, { as: "span", color: "gray.600", children: [
|
|
255
412
|
t("AbpUiMultiTenancy::Tenant"),
|
|
256
413
|
":",
|
|
257
414
|
" "
|
|
258
415
|
] }),
|
|
259
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ jsx4(Text, { as: "strong", children: /* @__PURE__ */ jsx4(Text, { as: "i", children: currentTenant?.name || t("AbpUiMultiTenancy::NotSelected") }) }),
|
|
260
417
|
" (",
|
|
261
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ jsx4(
|
|
262
419
|
Link,
|
|
263
420
|
{
|
|
264
421
|
id: "abp-tenant-switch-link",
|
|
@@ -273,34 +430,34 @@ function TenantBox({ containerStyle }) {
|
|
|
273
430
|
]
|
|
274
431
|
}
|
|
275
432
|
),
|
|
276
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ jsx4(
|
|
277
434
|
Modal,
|
|
278
435
|
{
|
|
279
436
|
visible: isModalVisible,
|
|
280
437
|
onVisibleChange: setIsModalVisible,
|
|
281
438
|
size: "md",
|
|
282
439
|
header: t("AbpUiMultiTenancy::SwitchTenant") || "Switch Tenant",
|
|
283
|
-
footer: /* @__PURE__ */
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
|
|
440
|
+
footer: /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
441
|
+
/* @__PURE__ */ jsx4(Button2, { variant: "ghost", colorPalette: "gray", onClick: onClose, children: t("AbpTenantManagement::Cancel") }),
|
|
442
|
+
/* @__PURE__ */ jsxs3(
|
|
443
|
+
Button2,
|
|
287
444
|
{
|
|
288
445
|
colorPalette: "blue",
|
|
289
446
|
onClick: save,
|
|
290
|
-
loading:
|
|
447
|
+
loading: inProgress,
|
|
291
448
|
loadingText: t("AbpTenantManagement::Save"),
|
|
292
449
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ jsx4(CheckIcon, {}),
|
|
294
451
|
t("AbpTenantManagement::Save")
|
|
295
452
|
]
|
|
296
453
|
}
|
|
297
454
|
)
|
|
298
455
|
] }),
|
|
299
|
-
children: /* @__PURE__ */
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
|
|
456
|
+
children: /* @__PURE__ */ jsx4("form", { onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs3(VStack, { gap: 4, align: "stretch", children: [
|
|
457
|
+
/* @__PURE__ */ jsxs3(Box2, { children: [
|
|
458
|
+
/* @__PURE__ */ jsx4(Text, { as: "label", mb: 1, display: "block", children: t("AbpUiMultiTenancy::Name") }),
|
|
459
|
+
/* @__PURE__ */ jsx4(
|
|
460
|
+
Input2,
|
|
304
461
|
{
|
|
305
462
|
id: "tenant-name",
|
|
306
463
|
type: "text",
|
|
@@ -310,14 +467,14 @@ function TenantBox({ containerStyle }) {
|
|
|
310
467
|
}
|
|
311
468
|
)
|
|
312
469
|
] }),
|
|
313
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ jsx4(Text, { fontSize: "sm", color: "gray.600", children: t("AbpUiMultiTenancy::SwitchTenantHint") })
|
|
314
471
|
] }) })
|
|
315
472
|
}
|
|
316
473
|
)
|
|
317
474
|
] });
|
|
318
475
|
}
|
|
319
476
|
function CheckIcon() {
|
|
320
|
-
return /* @__PURE__ */
|
|
477
|
+
return /* @__PURE__ */ jsx4(
|
|
321
478
|
"svg",
|
|
322
479
|
{
|
|
323
480
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -329,34 +486,27 @@ function CheckIcon() {
|
|
|
329
486
|
strokeWidth: "2",
|
|
330
487
|
strokeLinecap: "round",
|
|
331
488
|
strokeLinejoin: "round",
|
|
332
|
-
children: /* @__PURE__ */
|
|
489
|
+
children: /* @__PURE__ */ jsx4("polyline", { points: "20 6 9 17 4 12" })
|
|
333
490
|
}
|
|
334
491
|
);
|
|
335
492
|
}
|
|
336
493
|
|
|
337
494
|
// src/components/LoginForm/LoginForm.tsx
|
|
338
|
-
import { useForm } from "react-hook-form";
|
|
339
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
340
|
-
import { z } from "zod";
|
|
341
|
-
import { Link as RouterLink } from "react-router-dom";
|
|
342
|
-
import { useLocalization as useLocalization2 } from "@abpjs/core";
|
|
343
|
-
import { Alert, Button as Button2, Checkbox } from "@abpjs/theme-shared";
|
|
344
|
-
import { Box as Box2, Heading, Input as Input2, Link as Link2, HStack, Show } from "@chakra-ui/react";
|
|
345
495
|
import {
|
|
346
496
|
Card,
|
|
347
|
-
Container,
|
|
348
|
-
Field,
|
|
349
|
-
Flex,
|
|
350
|
-
InputGroup,
|
|
351
|
-
Stack,
|
|
497
|
+
Container as Container2,
|
|
498
|
+
Field as Field2,
|
|
499
|
+
Flex as Flex2,
|
|
500
|
+
InputGroup as InputGroup2,
|
|
501
|
+
Stack as Stack3,
|
|
352
502
|
Text as Text2
|
|
353
503
|
} from "@chakra-ui/react";
|
|
354
|
-
import { LuLock, LuMail } from "react-icons/lu";
|
|
355
|
-
import { jsx as
|
|
356
|
-
var loginSchema =
|
|
357
|
-
username:
|
|
358
|
-
password:
|
|
359
|
-
remember:
|
|
504
|
+
import { LuLock as LuLock2, LuMail } from "react-icons/lu";
|
|
505
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
506
|
+
var loginSchema = z2.object({
|
|
507
|
+
username: z2.string().min(1, "Username is required").max(255, "Username must be at most 255 characters"),
|
|
508
|
+
password: z2.string().min(1, "Password is required").max(32, "Password must be at most 32 characters"),
|
|
509
|
+
remember: z2.boolean().default(false)
|
|
360
510
|
});
|
|
361
511
|
function LoginForm({
|
|
362
512
|
showTenantBox = true,
|
|
@@ -365,14 +515,14 @@ function LoginForm({
|
|
|
365
515
|
onLoginSuccess,
|
|
366
516
|
onLoginError
|
|
367
517
|
}) {
|
|
368
|
-
const { t } =
|
|
518
|
+
const { t } = useLocalization3();
|
|
369
519
|
const { login, isLoading, error, clearError } = usePasswordFlow();
|
|
370
520
|
const {
|
|
371
521
|
register,
|
|
372
522
|
handleSubmit,
|
|
373
523
|
formState: { errors, isSubmitting }
|
|
374
|
-
} =
|
|
375
|
-
resolver:
|
|
524
|
+
} = useForm2({
|
|
525
|
+
resolver: zodResolver2(loginSchema),
|
|
376
526
|
defaultValues: {
|
|
377
527
|
username: "",
|
|
378
528
|
password: "",
|
|
@@ -391,16 +541,16 @@ function LoginForm({
|
|
|
391
541
|
}
|
|
392
542
|
};
|
|
393
543
|
const isFormLoading = isLoading || isSubmitting;
|
|
394
|
-
return /* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
error && /* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
|
|
544
|
+
return /* @__PURE__ */ jsx5(Flex2, { height: "full", flex: "1", children: /* @__PURE__ */ jsx5(Box3, { flex: "1.5", py: { base: "24", md: "32" }, children: /* @__PURE__ */ jsx5(Container2, { maxW: "md", children: /* @__PURE__ */ jsxs4(Stack3, { gap: "8", children: [
|
|
545
|
+
/* @__PURE__ */ jsx5(Show, { when: showTenantBox, children: /* @__PURE__ */ jsx5(TenantBox, {}) }),
|
|
546
|
+
/* @__PURE__ */ jsx5(Stack3, { gap: { base: "2", md: "3" }, textAlign: "center", children: /* @__PURE__ */ jsx5(Heading, { size: { base: "2xl", md: "3xl" }, children: t("AbpAccount::Login") }) }),
|
|
547
|
+
error && /* @__PURE__ */ jsx5(Alert, { status: "error", children: error }),
|
|
548
|
+
/* @__PURE__ */ jsx5("form", { onSubmit: handleSubmit(onSubmit), noValidate: true, children: /* @__PURE__ */ jsxs4(Stack3, { gap: "6", children: [
|
|
549
|
+
/* @__PURE__ */ jsxs4(Stack3, { gap: "5", children: [
|
|
550
|
+
/* @__PURE__ */ jsxs4(Field2.Root, { invalid: !!errors.username, children: [
|
|
551
|
+
/* @__PURE__ */ jsx5(Field2.Label, { children: t("AbpAccount::UserNameOrEmailAddress") }),
|
|
552
|
+
/* @__PURE__ */ jsx5(InputGroup2, { startElement: /* @__PURE__ */ jsx5(LuMail, {}), width: "full", children: /* @__PURE__ */ jsx5(
|
|
553
|
+
Input3,
|
|
404
554
|
{
|
|
405
555
|
id: "login-input-user-name-or-email-address",
|
|
406
556
|
type: "text",
|
|
@@ -409,12 +559,12 @@ function LoginForm({
|
|
|
409
559
|
...register("username")
|
|
410
560
|
}
|
|
411
561
|
) }),
|
|
412
|
-
errors.username && /* @__PURE__ */
|
|
562
|
+
errors.username && /* @__PURE__ */ jsx5(Field2.ErrorText, { children: errors.username.message })
|
|
413
563
|
] }),
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
|
|
564
|
+
/* @__PURE__ */ jsxs4(Field2.Root, { invalid: !!errors.password, children: [
|
|
565
|
+
/* @__PURE__ */ jsx5(Field2.Label, { children: t("AbpAccount::Password") }),
|
|
566
|
+
/* @__PURE__ */ jsx5(InputGroup2, { startElement: /* @__PURE__ */ jsx5(LuLock2, {}), width: "full", children: /* @__PURE__ */ jsx5(
|
|
567
|
+
Input3,
|
|
418
568
|
{
|
|
419
569
|
id: "login-input-password",
|
|
420
570
|
type: "password",
|
|
@@ -423,11 +573,11 @@ function LoginForm({
|
|
|
423
573
|
...register("password")
|
|
424
574
|
}
|
|
425
575
|
) }),
|
|
426
|
-
errors.password && /* @__PURE__ */
|
|
576
|
+
errors.password && /* @__PURE__ */ jsx5(Field2.ErrorText, { children: errors.password.message })
|
|
427
577
|
] }),
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
|
|
578
|
+
/* @__PURE__ */ jsx5(Checkbox, { id: "login-input-remember-me", ...register("remember"), children: t("AbpAccount::RememberMe") }),
|
|
579
|
+
/* @__PURE__ */ jsx5(
|
|
580
|
+
Button3,
|
|
431
581
|
{
|
|
432
582
|
type: "submit",
|
|
433
583
|
colorPalette: "blue",
|
|
@@ -436,56 +586,265 @@ function LoginForm({
|
|
|
436
586
|
children: t("AbpAccount::Login")
|
|
437
587
|
}
|
|
438
588
|
),
|
|
439
|
-
/* @__PURE__ */
|
|
589
|
+
/* @__PURE__ */ jsx5(Link2, { variant: "plain", children: t("AbpAccount::ForgotPassword") })
|
|
440
590
|
] }),
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ jsx5(Show, { when: showRegisterLink, children: /* @__PURE__ */ jsx5(Card.Root, { size: "sm", mt: "10", children: /* @__PURE__ */ jsx5(Card.Body, { children: /* @__PURE__ */ jsxs4(HStack, { textStyle: "sm", children: [
|
|
592
|
+
/* @__PURE__ */ jsx5(Text2, { children: t("AbpAccount::AreYouANewUser") }),
|
|
593
|
+
/* @__PURE__ */ jsx5(Link2, { asChild: true, variant: "underline", fontWeight: "semibold", children: /* @__PURE__ */ jsx5(RouterLink, { to: registerUrl, children: t("AbpAccount::Register") }) })
|
|
444
594
|
] }) }) }) })
|
|
445
595
|
] }) })
|
|
446
596
|
] }) }) }) });
|
|
447
597
|
}
|
|
448
598
|
|
|
599
|
+
// src/components/ManageProfile/ManageProfile.tsx
|
|
600
|
+
import { useState as useState5 } from "react";
|
|
601
|
+
import { useLocalization as useLocalization5 } from "@abpjs/core";
|
|
602
|
+
import { Box as Box4, Container as Container3, Heading as Heading2, Stack as Stack5, Tabs } from "@chakra-ui/react";
|
|
603
|
+
|
|
604
|
+
// src/components/PersonalSettingsForm/PersonalSettingsForm.tsx
|
|
605
|
+
import { useState as useState4, useEffect as useEffect3 } from "react";
|
|
606
|
+
import { useForm as useForm3 } from "react-hook-form";
|
|
607
|
+
import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
|
|
608
|
+
import { z as z3 } from "zod";
|
|
609
|
+
import { useLocalization as useLocalization4, useProfile as useProfile2 } from "@abpjs/core";
|
|
610
|
+
import { Button as Button4, useToaster as useToaster3 } from "@abpjs/theme-shared";
|
|
611
|
+
import { Input as Input4, Stack as Stack4 } from "@chakra-ui/react";
|
|
612
|
+
import { Field as Field3, InputGroup as InputGroup3 } from "@chakra-ui/react";
|
|
613
|
+
import { LuMail as LuMail2, LuUser, LuPhone } from "react-icons/lu";
|
|
614
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
615
|
+
var personalSettingsSchema = z3.object({
|
|
616
|
+
userName: z3.string().min(1, "Username is required").max(255, "Username must be at most 255 characters"),
|
|
617
|
+
email: z3.string().min(1, "Email is required").email("Please enter a valid email address"),
|
|
618
|
+
name: z3.string().max(64, "Name must be at most 64 characters").optional(),
|
|
619
|
+
surname: z3.string().max(64, "Surname must be at most 64 characters").optional(),
|
|
620
|
+
phoneNumber: z3.string().max(16, "Phone number must be at most 16 characters").optional()
|
|
621
|
+
});
|
|
622
|
+
function PersonalSettingsForm({ onSuccess, onError }) {
|
|
623
|
+
const { t } = useLocalization4();
|
|
624
|
+
const { profile, loading, fetchProfile, updateProfile } = useProfile2();
|
|
625
|
+
const toaster = useToaster3();
|
|
626
|
+
const [inProgress, setInProgress] = useState4(false);
|
|
627
|
+
const {
|
|
628
|
+
register,
|
|
629
|
+
handleSubmit,
|
|
630
|
+
reset,
|
|
631
|
+
formState: { errors }
|
|
632
|
+
} = useForm3({
|
|
633
|
+
resolver: zodResolver3(personalSettingsSchema),
|
|
634
|
+
defaultValues: {
|
|
635
|
+
userName: "",
|
|
636
|
+
email: "",
|
|
637
|
+
name: "",
|
|
638
|
+
surname: "",
|
|
639
|
+
phoneNumber: ""
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
useEffect3(() => {
|
|
643
|
+
fetchProfile();
|
|
644
|
+
}, [fetchProfile]);
|
|
645
|
+
useEffect3(() => {
|
|
646
|
+
if (profile) {
|
|
647
|
+
reset({
|
|
648
|
+
userName: profile.userName || "",
|
|
649
|
+
email: profile.email || "",
|
|
650
|
+
name: profile.name || "",
|
|
651
|
+
surname: profile.surname || "",
|
|
652
|
+
phoneNumber: profile.phoneNumber || ""
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
}, [profile, reset]);
|
|
656
|
+
const submit = async (data) => {
|
|
657
|
+
setInProgress(true);
|
|
658
|
+
try {
|
|
659
|
+
const updateData = {
|
|
660
|
+
userName: data.userName,
|
|
661
|
+
email: data.email,
|
|
662
|
+
name: data.name || "",
|
|
663
|
+
surname: data.surname || "",
|
|
664
|
+
phoneNumber: data.phoneNumber || ""
|
|
665
|
+
};
|
|
666
|
+
await updateProfile(updateData);
|
|
667
|
+
toaster.success(
|
|
668
|
+
t("AbpAccount::PersonalSettingsSaved") || "Personal settings have been saved successfully.",
|
|
669
|
+
t("AbpAccount::Success") || "Success"
|
|
670
|
+
);
|
|
671
|
+
onSuccess?.();
|
|
672
|
+
} catch (err) {
|
|
673
|
+
const errorMessage = err?.error?.error_description || err?.error?.error?.message || t("AbpAccount::DefaultErrorMessage") || "An error occurred";
|
|
674
|
+
toaster.error(errorMessage, t("AbpUi::Error") || "Error", { life: 7e3 });
|
|
675
|
+
onError?.(errorMessage);
|
|
676
|
+
} finally {
|
|
677
|
+
setInProgress(false);
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
if (loading && !profile) {
|
|
681
|
+
return null;
|
|
682
|
+
}
|
|
683
|
+
return /* @__PURE__ */ jsx6("form", { onSubmit: handleSubmit(submit), noValidate: true, children: /* @__PURE__ */ jsxs5(Stack4, { gap: "5", children: [
|
|
684
|
+
/* @__PURE__ */ jsxs5(Field3.Root, { invalid: !!errors.userName, children: [
|
|
685
|
+
/* @__PURE__ */ jsx6(Field3.Label, { children: t("AbpAccount::UserName") }),
|
|
686
|
+
/* @__PURE__ */ jsx6(InputGroup3, { startElement: /* @__PURE__ */ jsx6(LuUser, {}), width: "full", children: /* @__PURE__ */ jsx6(
|
|
687
|
+
Input4,
|
|
688
|
+
{
|
|
689
|
+
id: "user-name",
|
|
690
|
+
type: "text",
|
|
691
|
+
autoComplete: "username",
|
|
692
|
+
...register("userName")
|
|
693
|
+
}
|
|
694
|
+
) }),
|
|
695
|
+
errors.userName && /* @__PURE__ */ jsx6(Field3.ErrorText, { children: errors.userName.message })
|
|
696
|
+
] }),
|
|
697
|
+
/* @__PURE__ */ jsxs5(Field3.Root, { invalid: !!errors.email, children: [
|
|
698
|
+
/* @__PURE__ */ jsx6(Field3.Label, { children: t("AbpAccount::EmailAddress") }),
|
|
699
|
+
/* @__PURE__ */ jsx6(InputGroup3, { startElement: /* @__PURE__ */ jsx6(LuMail2, {}), width: "full", children: /* @__PURE__ */ jsx6(
|
|
700
|
+
Input4,
|
|
701
|
+
{
|
|
702
|
+
id: "email",
|
|
703
|
+
type: "email",
|
|
704
|
+
autoComplete: "email",
|
|
705
|
+
...register("email")
|
|
706
|
+
}
|
|
707
|
+
) }),
|
|
708
|
+
errors.email && /* @__PURE__ */ jsx6(Field3.ErrorText, { children: errors.email.message })
|
|
709
|
+
] }),
|
|
710
|
+
/* @__PURE__ */ jsxs5(Field3.Root, { invalid: !!errors.name, children: [
|
|
711
|
+
/* @__PURE__ */ jsx6(Field3.Label, { children: t("AbpAccount::DisplayName:Name") }),
|
|
712
|
+
/* @__PURE__ */ jsx6(InputGroup3, { startElement: /* @__PURE__ */ jsx6(LuUser, {}), width: "full", children: /* @__PURE__ */ jsx6(
|
|
713
|
+
Input4,
|
|
714
|
+
{
|
|
715
|
+
id: "name",
|
|
716
|
+
type: "text",
|
|
717
|
+
autoComplete: "given-name",
|
|
718
|
+
...register("name")
|
|
719
|
+
}
|
|
720
|
+
) }),
|
|
721
|
+
errors.name && /* @__PURE__ */ jsx6(Field3.ErrorText, { children: errors.name.message })
|
|
722
|
+
] }),
|
|
723
|
+
/* @__PURE__ */ jsxs5(Field3.Root, { invalid: !!errors.surname, children: [
|
|
724
|
+
/* @__PURE__ */ jsx6(Field3.Label, { children: t("AbpAccount::DisplayName:Surname") }),
|
|
725
|
+
/* @__PURE__ */ jsx6(InputGroup3, { startElement: /* @__PURE__ */ jsx6(LuUser, {}), width: "full", children: /* @__PURE__ */ jsx6(
|
|
726
|
+
Input4,
|
|
727
|
+
{
|
|
728
|
+
id: "surname",
|
|
729
|
+
type: "text",
|
|
730
|
+
autoComplete: "family-name",
|
|
731
|
+
...register("surname")
|
|
732
|
+
}
|
|
733
|
+
) }),
|
|
734
|
+
errors.surname && /* @__PURE__ */ jsx6(Field3.ErrorText, { children: errors.surname.message })
|
|
735
|
+
] }),
|
|
736
|
+
/* @__PURE__ */ jsxs5(Field3.Root, { invalid: !!errors.phoneNumber, children: [
|
|
737
|
+
/* @__PURE__ */ jsx6(Field3.Label, { children: t("AbpAccount::PhoneNumber") }),
|
|
738
|
+
/* @__PURE__ */ jsx6(InputGroup3, { startElement: /* @__PURE__ */ jsx6(LuPhone, {}), width: "full", children: /* @__PURE__ */ jsx6(
|
|
739
|
+
Input4,
|
|
740
|
+
{
|
|
741
|
+
id: "phone-number",
|
|
742
|
+
type: "tel",
|
|
743
|
+
autoComplete: "tel",
|
|
744
|
+
...register("phoneNumber")
|
|
745
|
+
}
|
|
746
|
+
) }),
|
|
747
|
+
errors.phoneNumber && /* @__PURE__ */ jsx6(Field3.ErrorText, { children: errors.phoneNumber.message })
|
|
748
|
+
] }),
|
|
749
|
+
/* @__PURE__ */ jsx6(
|
|
750
|
+
Button4,
|
|
751
|
+
{
|
|
752
|
+
type: "submit",
|
|
753
|
+
colorPalette: "blue",
|
|
754
|
+
loading: inProgress,
|
|
755
|
+
loadingText: t("AbpAccount::Submit"),
|
|
756
|
+
children: t("AbpAccount::Submit")
|
|
757
|
+
}
|
|
758
|
+
)
|
|
759
|
+
] }) });
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
// src/components/ManageProfile/ManageProfile.tsx
|
|
763
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
764
|
+
function ManageProfile({
|
|
765
|
+
defaultTabIndex = 0,
|
|
766
|
+
onTabChange,
|
|
767
|
+
customTabs
|
|
768
|
+
}) {
|
|
769
|
+
const { t } = useLocalization5();
|
|
770
|
+
const [selectedTab, setSelectedTab] = useState5(defaultTabIndex);
|
|
771
|
+
const defaultTabs = [
|
|
772
|
+
{
|
|
773
|
+
id: "personal-settings",
|
|
774
|
+
label: t("AbpAccount::PersonalSettings") || "Personal Settings",
|
|
775
|
+
content: /* @__PURE__ */ jsx7(PersonalSettingsForm, {})
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
id: "change-password",
|
|
779
|
+
label: t("AbpAccount::ChangePassword") || "Change Password",
|
|
780
|
+
content: /* @__PURE__ */ jsx7(ChangePasswordForm, {})
|
|
781
|
+
}
|
|
782
|
+
];
|
|
783
|
+
const tabs = customTabs || defaultTabs;
|
|
784
|
+
const handleTabChange = (details) => {
|
|
785
|
+
const index = tabs.findIndex((tab) => tab.id === details.value);
|
|
786
|
+
if (index !== -1) {
|
|
787
|
+
setSelectedTab(index);
|
|
788
|
+
onTabChange?.(index);
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
return /* @__PURE__ */ jsx7(Box4, { className: "manage-profile", py: { base: "8", md: "12" }, children: /* @__PURE__ */ jsx7(Container3, { maxW: "2xl", children: /* @__PURE__ */ jsxs6(Stack5, { gap: "8", children: [
|
|
792
|
+
/* @__PURE__ */ jsx7(Heading2, { size: "xl", children: t("AbpAccount::ManageYourAccount") || "Manage Your Account" }),
|
|
793
|
+
/* @__PURE__ */ jsxs6(
|
|
794
|
+
Tabs.Root,
|
|
795
|
+
{
|
|
796
|
+
value: tabs[selectedTab]?.id,
|
|
797
|
+
onValueChange: handleTabChange,
|
|
798
|
+
variant: "enclosed",
|
|
799
|
+
children: [
|
|
800
|
+
/* @__PURE__ */ jsx7(Tabs.List, { children: tabs.map((tab) => /* @__PURE__ */ jsx7(Tabs.Trigger, { value: tab.id, children: tab.label }, tab.id)) }),
|
|
801
|
+
tabs.map((tab) => /* @__PURE__ */ jsx7(Tabs.Content, { value: tab.id, children: /* @__PURE__ */ jsx7(Box4, { pt: 6, children: tab.content }) }, tab.id))
|
|
802
|
+
]
|
|
803
|
+
}
|
|
804
|
+
)
|
|
805
|
+
] }) }) });
|
|
806
|
+
}
|
|
807
|
+
|
|
449
808
|
// src/components/RegisterForm/RegisterForm.tsx
|
|
450
|
-
import { useState as
|
|
451
|
-
import { useForm as
|
|
452
|
-
import { zodResolver as
|
|
453
|
-
import { z as
|
|
809
|
+
import { useState as useState6 } from "react";
|
|
810
|
+
import { useForm as useForm4 } from "react-hook-form";
|
|
811
|
+
import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
|
|
812
|
+
import { z as z4 } from "zod";
|
|
454
813
|
import { Link as RouterLink2, useNavigate as useNavigate2 } from "react-router-dom";
|
|
455
|
-
import { useLocalization as
|
|
456
|
-
import { Button as
|
|
457
|
-
import { Box as
|
|
814
|
+
import { useLocalization as useLocalization6, useUserManager, useAbp as useAbp2, configActions as configActions2 } from "@abpjs/core";
|
|
815
|
+
import { Button as Button5, useToaster as useToaster4 } from "@abpjs/theme-shared";
|
|
816
|
+
import { Box as Box5, Heading as Heading3, Input as Input5, Link as Link3, HStack as HStack2, Show as Show2 } from "@chakra-ui/react";
|
|
458
817
|
import {
|
|
459
818
|
Card as Card2,
|
|
460
|
-
Container as
|
|
461
|
-
Field as
|
|
462
|
-
Flex as
|
|
463
|
-
InputGroup as
|
|
464
|
-
Stack as
|
|
819
|
+
Container as Container4,
|
|
820
|
+
Field as Field4,
|
|
821
|
+
Flex as Flex3,
|
|
822
|
+
InputGroup as InputGroup4,
|
|
823
|
+
Stack as Stack6,
|
|
465
824
|
Text as Text3
|
|
466
825
|
} from "@chakra-ui/react";
|
|
467
|
-
import { LuLock as
|
|
468
|
-
import { jsx as
|
|
469
|
-
var
|
|
826
|
+
import { LuLock as LuLock3, LuMail as LuMail3, LuUser as LuUser2 } from "react-icons/lu";
|
|
827
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
828
|
+
var passwordValidation2 = {
|
|
470
829
|
hasLowercase: /[a-z]/,
|
|
471
830
|
hasUppercase: /[A-Z]/,
|
|
472
831
|
hasNumber: /[0-9]/,
|
|
473
832
|
hasSpecial: /[!@#$%^&*(),.?":{}|<>]/
|
|
474
833
|
};
|
|
475
|
-
var registerSchema =
|
|
476
|
-
username:
|
|
477
|
-
email:
|
|
478
|
-
password:
|
|
479
|
-
(val) =>
|
|
834
|
+
var registerSchema = z4.object({
|
|
835
|
+
username: z4.string().min(1, "Username is required").max(255, "Username must be at most 255 characters"),
|
|
836
|
+
email: z4.string().min(1, "Email is required").email("Please enter a valid email address"),
|
|
837
|
+
password: z4.string().min(6, "Password must be at least 6 characters").max(32, "Password must be at most 32 characters").refine(
|
|
838
|
+
(val) => passwordValidation2.hasLowercase.test(val),
|
|
480
839
|
"Password must contain at least one lowercase letter"
|
|
481
840
|
).refine(
|
|
482
|
-
(val) =>
|
|
841
|
+
(val) => passwordValidation2.hasUppercase.test(val),
|
|
483
842
|
"Password must contain at least one uppercase letter"
|
|
484
843
|
).refine(
|
|
485
|
-
(val) =>
|
|
844
|
+
(val) => passwordValidation2.hasNumber.test(val),
|
|
486
845
|
"Password must contain at least one number"
|
|
487
846
|
).refine(
|
|
488
|
-
(val) =>
|
|
847
|
+
(val) => passwordValidation2.hasSpecial.test(val),
|
|
489
848
|
"Password must contain at least one special character"
|
|
490
849
|
)
|
|
491
850
|
});
|
|
@@ -496,19 +855,19 @@ function RegisterForm({
|
|
|
496
855
|
onRegisterSuccess,
|
|
497
856
|
onRegisterError
|
|
498
857
|
}) {
|
|
499
|
-
const { t } =
|
|
858
|
+
const { t } = useLocalization6();
|
|
500
859
|
const navigate = useNavigate2();
|
|
501
860
|
const accountService = useAccountService();
|
|
502
|
-
const toaster =
|
|
861
|
+
const toaster = useToaster4();
|
|
503
862
|
const userManager = useUserManager();
|
|
504
863
|
const { store, applicationConfigurationService } = useAbp2();
|
|
505
|
-
const [inProgress, setInProgress] =
|
|
864
|
+
const [inProgress, setInProgress] = useState6(false);
|
|
506
865
|
const {
|
|
507
866
|
register,
|
|
508
867
|
handleSubmit,
|
|
509
868
|
formState: { errors }
|
|
510
|
-
} =
|
|
511
|
-
resolver:
|
|
869
|
+
} = useForm4({
|
|
870
|
+
resolver: zodResolver4(registerSchema),
|
|
512
871
|
defaultValues: {
|
|
513
872
|
username: "",
|
|
514
873
|
email: "",
|
|
@@ -560,15 +919,15 @@ function RegisterForm({
|
|
|
560
919
|
setInProgress(false);
|
|
561
920
|
}
|
|
562
921
|
};
|
|
563
|
-
return /* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */
|
|
571
|
-
|
|
922
|
+
return /* @__PURE__ */ jsx8(Flex3, { height: "full", flex: "1", children: /* @__PURE__ */ jsx8(Box5, { flex: "1.5", py: { base: "24", md: "32" }, children: /* @__PURE__ */ jsx8(Container4, { maxW: "md", children: /* @__PURE__ */ jsxs7(Stack6, { gap: "8", children: [
|
|
923
|
+
/* @__PURE__ */ jsx8(Show2, { when: showTenantBox, children: /* @__PURE__ */ jsx8(TenantBox, {}) }),
|
|
924
|
+
/* @__PURE__ */ jsx8(Stack6, { gap: { base: "2", md: "3" }, textAlign: "center", children: /* @__PURE__ */ jsx8(Heading3, { size: { base: "2xl", md: "3xl" }, children: t("AbpAccount::Register") }) }),
|
|
925
|
+
/* @__PURE__ */ jsx8("form", { onSubmit: handleSubmit(onSubmit), noValidate: true, children: /* @__PURE__ */ jsxs7(Stack6, { gap: "6", children: [
|
|
926
|
+
/* @__PURE__ */ jsxs7(Stack6, { gap: "5", children: [
|
|
927
|
+
/* @__PURE__ */ jsxs7(Field4.Root, { invalid: !!errors.username, children: [
|
|
928
|
+
/* @__PURE__ */ jsx8(Field4.Label, { children: t("AbpAccount::UserName") }),
|
|
929
|
+
/* @__PURE__ */ jsx8(InputGroup4, { startElement: /* @__PURE__ */ jsx8(LuUser2, {}), width: "full", children: /* @__PURE__ */ jsx8(
|
|
930
|
+
Input5,
|
|
572
931
|
{
|
|
573
932
|
id: "input-user-name",
|
|
574
933
|
type: "text",
|
|
@@ -578,12 +937,12 @@ function RegisterForm({
|
|
|
578
937
|
...register("username")
|
|
579
938
|
}
|
|
580
939
|
) }),
|
|
581
|
-
errors.username && /* @__PURE__ */
|
|
940
|
+
errors.username && /* @__PURE__ */ jsx8(Field4.ErrorText, { children: errors.username.message })
|
|
582
941
|
] }),
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
|
|
942
|
+
/* @__PURE__ */ jsxs7(Field4.Root, { invalid: !!errors.email, children: [
|
|
943
|
+
/* @__PURE__ */ jsx8(Field4.Label, { children: t("AbpAccount::EmailAddress") }),
|
|
944
|
+
/* @__PURE__ */ jsx8(InputGroup4, { startElement: /* @__PURE__ */ jsx8(LuMail3, {}), width: "full", children: /* @__PURE__ */ jsx8(
|
|
945
|
+
Input5,
|
|
587
946
|
{
|
|
588
947
|
id: "input-email-address",
|
|
589
948
|
type: "email",
|
|
@@ -592,12 +951,12 @@ function RegisterForm({
|
|
|
592
951
|
...register("email")
|
|
593
952
|
}
|
|
594
953
|
) }),
|
|
595
|
-
errors.email && /* @__PURE__ */
|
|
954
|
+
errors.email && /* @__PURE__ */ jsx8(Field4.ErrorText, { children: errors.email.message })
|
|
596
955
|
] }),
|
|
597
|
-
/* @__PURE__ */
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
|
|
956
|
+
/* @__PURE__ */ jsxs7(Field4.Root, { invalid: !!errors.password, children: [
|
|
957
|
+
/* @__PURE__ */ jsx8(Field4.Label, { children: t("AbpAccount::Password") }),
|
|
958
|
+
/* @__PURE__ */ jsx8(InputGroup4, { startElement: /* @__PURE__ */ jsx8(LuLock3, {}), width: "full", children: /* @__PURE__ */ jsx8(
|
|
959
|
+
Input5,
|
|
601
960
|
{
|
|
602
961
|
id: "input-password",
|
|
603
962
|
type: "password",
|
|
@@ -606,10 +965,10 @@ function RegisterForm({
|
|
|
606
965
|
...register("password")
|
|
607
966
|
}
|
|
608
967
|
) }),
|
|
609
|
-
errors.password && /* @__PURE__ */
|
|
968
|
+
errors.password && /* @__PURE__ */ jsx8(Field4.ErrorText, { children: errors.password.message })
|
|
610
969
|
] }),
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
|
|
970
|
+
/* @__PURE__ */ jsx8(
|
|
971
|
+
Button5,
|
|
613
972
|
{
|
|
614
973
|
type: "submit",
|
|
615
974
|
colorPalette: "blue",
|
|
@@ -619,32 +978,32 @@ function RegisterForm({
|
|
|
619
978
|
}
|
|
620
979
|
)
|
|
621
980
|
] }),
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ jsx8(Show2, { when: showLoginLink, children: /* @__PURE__ */ jsx8(Card2.Root, { size: "sm", mt: "10", children: /* @__PURE__ */ jsx8(Card2.Body, { children: /* @__PURE__ */ jsxs7(HStack2, { textStyle: "sm", children: [
|
|
982
|
+
/* @__PURE__ */ jsx8(Text3, { children: t("AbpAccount::AlreadyRegistered") }),
|
|
983
|
+
/* @__PURE__ */ jsx8(Link3, { asChild: true, variant: "underline", fontWeight: "semibold", children: /* @__PURE__ */ jsx8(RouterLink2, { to: loginUrl, children: t("AbpAccount::Login") }) })
|
|
625
984
|
] }) }) }) })
|
|
626
985
|
] }) })
|
|
627
986
|
] }) }) }) });
|
|
628
987
|
}
|
|
629
988
|
|
|
630
989
|
// src/pages/LoginPage.tsx
|
|
631
|
-
import { Container as
|
|
632
|
-
import { jsx as
|
|
990
|
+
import { Container as Container5, Center } from "@chakra-ui/react";
|
|
991
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
633
992
|
function LoginPage({
|
|
634
993
|
maxWidth = "container.sm",
|
|
635
994
|
...loginFormProps
|
|
636
995
|
}) {
|
|
637
|
-
return /* @__PURE__ */
|
|
996
|
+
return /* @__PURE__ */ jsx9(Container5, { maxW: maxWidth, py: 10, children: /* @__PURE__ */ jsx9(Center, { children: /* @__PURE__ */ jsx9(LoginForm, { ...loginFormProps }) }) });
|
|
638
997
|
}
|
|
639
998
|
|
|
640
999
|
// src/pages/RegisterPage.tsx
|
|
641
|
-
import { Container as
|
|
642
|
-
import { jsx as
|
|
1000
|
+
import { Container as Container6, Center as Center2 } from "@chakra-ui/react";
|
|
1001
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
643
1002
|
function RegisterPage({
|
|
644
1003
|
maxWidth = "container.sm",
|
|
645
1004
|
...registerFormProps
|
|
646
1005
|
}) {
|
|
647
|
-
return /* @__PURE__ */
|
|
1006
|
+
return /* @__PURE__ */ jsx10(Container6, { maxW: maxWidth, py: 10, children: /* @__PURE__ */ jsx10(Center2, { children: /* @__PURE__ */ jsx10(RegisterForm, { ...registerFormProps }) }) });
|
|
648
1007
|
}
|
|
649
1008
|
|
|
650
1009
|
// src/routes/index.ts
|
|
@@ -681,9 +1040,13 @@ export {
|
|
|
681
1040
|
ACCOUNT_ROUTES,
|
|
682
1041
|
AccountProvider,
|
|
683
1042
|
AccountService,
|
|
1043
|
+
AuthWrapper,
|
|
1044
|
+
ChangePasswordForm,
|
|
684
1045
|
DEFAULT_REDIRECT_URL,
|
|
685
1046
|
LoginForm,
|
|
686
1047
|
LoginPage,
|
|
1048
|
+
ManageProfile,
|
|
1049
|
+
PersonalSettingsForm,
|
|
687
1050
|
RegisterForm,
|
|
688
1051
|
RegisterPage,
|
|
689
1052
|
TenantBox,
|