@ttoss/react-auth 2.5.11 → 2.5.13
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/esm/index.js +115 -143
- package/i18n/compiled/en.json +16 -10
- package/i18n/lang/en.json +9 -8
- package/package.json +10 -11
package/dist/esm/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
2
|
|
|
3
3
|
// src/Auth.tsx
|
|
4
|
+
import { useI18n as useI18n6 } from "@ttoss/react-i18n";
|
|
4
5
|
import { useNotifications as useNotifications2 } from "@ttoss/react-notifications";
|
|
5
6
|
import { Flex as Flex5 } from "@ttoss/ui";
|
|
6
|
-
import { useMachine } from "@xstate/react";
|
|
7
7
|
import { confirmResetPassword, confirmSignUp, resendSignUpCode, resetPassword, signIn, signUp } from "aws-amplify/auth";
|
|
8
8
|
import * as React5 from "react";
|
|
9
|
-
import { assign, createMachine } from "xstate";
|
|
10
9
|
|
|
11
10
|
// src/AuthCard.tsx
|
|
12
11
|
import { useNotifications } from "@ttoss/react-notifications";
|
|
@@ -38,6 +37,7 @@ var AuthCard = ({
|
|
|
38
37
|
} = useNotifications();
|
|
39
38
|
return /* @__PURE__ */jsxs(Box, {
|
|
40
39
|
sx: {
|
|
40
|
+
maxWidth: "400px",
|
|
41
41
|
width: "full",
|
|
42
42
|
border: "md",
|
|
43
43
|
borderColor: "display.border.muted.default",
|
|
@@ -89,9 +89,10 @@ var AuthCard = ({
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
// src/AuthConfirmSignUp.tsx
|
|
92
|
+
import { NotificationCard } from "@ttoss/components/NotificationCard";
|
|
92
93
|
import { Form, FormFieldInput, useForm, yup, yupResolver } from "@ttoss/forms";
|
|
93
94
|
import { useI18n } from "@ttoss/react-i18n";
|
|
94
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
95
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
95
96
|
var AuthConfirmSignUp = ({
|
|
96
97
|
email,
|
|
97
98
|
onConfirmSignUp
|
|
@@ -135,7 +136,7 @@ var AuthConfirmSignUp = ({
|
|
|
135
136
|
email
|
|
136
137
|
});
|
|
137
138
|
},
|
|
138
|
-
children: /* @__PURE__ */
|
|
139
|
+
children: /* @__PURE__ */jsxs2(AuthCard, {
|
|
139
140
|
buttonLabel: intl.formatMessage({
|
|
140
141
|
id: "UNttd+",
|
|
141
142
|
defaultMessage: [{
|
|
@@ -151,7 +152,19 @@ var AuthConfirmSignUp = ({
|
|
|
151
152
|
"value": "Confirmation"
|
|
152
153
|
}]
|
|
153
154
|
}),
|
|
154
|
-
children: /* @__PURE__ */jsx2(
|
|
155
|
+
children: [/* @__PURE__ */jsx2(NotificationCard, {
|
|
156
|
+
type: "info",
|
|
157
|
+
message: intl.formatMessage({
|
|
158
|
+
id: "pwv2cR",
|
|
159
|
+
defaultMessage: [{
|
|
160
|
+
"type": 0,
|
|
161
|
+
"value": "We have sent a confirmation code to your email address. Please enter the code below."
|
|
162
|
+
}]
|
|
163
|
+
})
|
|
164
|
+
}), /* @__PURE__ */jsx2(FormFieldInput, {
|
|
165
|
+
sx: {
|
|
166
|
+
marginTop: "6"
|
|
167
|
+
},
|
|
155
168
|
name: "code",
|
|
156
169
|
label: intl.formatMessage({
|
|
157
170
|
id: "KY2T6J",
|
|
@@ -160,7 +173,7 @@ var AuthConfirmSignUp = ({
|
|
|
160
173
|
"value": "Code"
|
|
161
174
|
}]
|
|
162
175
|
})
|
|
163
|
-
})
|
|
176
|
+
})]
|
|
164
177
|
})
|
|
165
178
|
});
|
|
166
179
|
};
|
|
@@ -170,7 +183,7 @@ import { Form as Form2, FormFieldInput as FormFieldInput2, useForm as useForm2,
|
|
|
170
183
|
import { useI18n as useI18n2 } from "@ttoss/react-i18n";
|
|
171
184
|
import { NotificationsBox } from "@ttoss/react-notifications";
|
|
172
185
|
import { Button as Button2, Link, Text } from "@ttoss/ui";
|
|
173
|
-
import { jsx as jsx3, jsxs as
|
|
186
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
174
187
|
var AuthForgotPassword = ({
|
|
175
188
|
onForgotPassword,
|
|
176
189
|
onCancel,
|
|
@@ -210,7 +223,7 @@ var AuthForgotPassword = ({
|
|
|
210
223
|
email
|
|
211
224
|
});
|
|
212
225
|
},
|
|
213
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */jsxs3(AuthCard, {
|
|
214
227
|
buttonLabel: intl.formatMessage({
|
|
215
228
|
id: "mZzmNV",
|
|
216
229
|
defaultMessage: [{
|
|
@@ -278,7 +291,7 @@ import { useI18n as useI18n3 } from "@ttoss/react-i18n";
|
|
|
278
291
|
import { NotificationsBox as NotificationsBox2 } from "@ttoss/react-notifications";
|
|
279
292
|
import { Button as Button3 } from "@ttoss/ui";
|
|
280
293
|
import * as React2 from "react";
|
|
281
|
-
import { jsx as jsx4, jsxs as
|
|
294
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
282
295
|
var AuthForgotPasswordResetPassword = ({
|
|
283
296
|
email,
|
|
284
297
|
onForgotPasswordResetPassword,
|
|
@@ -365,7 +378,7 @@ var AuthForgotPasswordResetPassword = ({
|
|
|
365
378
|
newPassword: password
|
|
366
379
|
});
|
|
367
380
|
},
|
|
368
|
-
children: /* @__PURE__ */
|
|
381
|
+
children: /* @__PURE__ */jsxs4(AuthCard, {
|
|
369
382
|
buttonLabel: intl.formatMessage({
|
|
370
383
|
id: "mZzmNV",
|
|
371
384
|
defaultMessage: [{
|
|
@@ -533,7 +546,7 @@ import { Form as Form4, FormFieldInput as FormFieldInput4, FormFieldPassword as
|
|
|
533
546
|
import { useI18n as useI18n4 } from "@ttoss/react-i18n";
|
|
534
547
|
import { NotificationsBox as NotificationsBox3 } from "@ttoss/react-notifications";
|
|
535
548
|
import { Button as Button4, Flex as Flex3, Link as Link2, Text as Text2 } from "@ttoss/ui";
|
|
536
|
-
import { jsx as jsx7, jsxs as
|
|
549
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
537
550
|
var AuthSignIn = ({
|
|
538
551
|
onSignIn,
|
|
539
552
|
onSignUp,
|
|
@@ -595,19 +608,19 @@ var AuthSignIn = ({
|
|
|
595
608
|
},
|
|
596
609
|
...formMethods,
|
|
597
610
|
onSubmit: onSubmitForm,
|
|
598
|
-
children: /* @__PURE__ */
|
|
611
|
+
children: /* @__PURE__ */jsxs5(AuthCard, {
|
|
599
612
|
title: intl.formatMessage({
|
|
600
|
-
id: "
|
|
613
|
+
id: "SQJto2",
|
|
601
614
|
defaultMessage: [{
|
|
602
615
|
"type": 0,
|
|
603
|
-
"value": "
|
|
616
|
+
"value": "Sign in"
|
|
604
617
|
}]
|
|
605
618
|
}),
|
|
606
619
|
buttonLabel: intl.formatMessage({
|
|
607
|
-
id: "
|
|
620
|
+
id: "SQJto2",
|
|
608
621
|
defaultMessage: [{
|
|
609
622
|
"type": 0,
|
|
610
|
-
"value": "
|
|
623
|
+
"value": "Sign in"
|
|
611
624
|
}]
|
|
612
625
|
}),
|
|
613
626
|
isValidForm: formMethods.formState.isValid,
|
|
@@ -628,7 +641,7 @@ var AuthSignIn = ({
|
|
|
628
641
|
}]
|
|
629
642
|
})
|
|
630
643
|
}),
|
|
631
|
-
children: [/* @__PURE__ */
|
|
644
|
+
children: [/* @__PURE__ */jsxs5(Flex3, {
|
|
632
645
|
sx: {
|
|
633
646
|
flexDirection: "column",
|
|
634
647
|
gap: "xl"
|
|
@@ -683,7 +696,7 @@ import { useI18n as useI18n5 } from "@ttoss/react-i18n";
|
|
|
683
696
|
import { NotificationsBox as NotificationsBox4 } from "@ttoss/react-notifications";
|
|
684
697
|
import { Flex as Flex4, Link as Link3, Text as Text3 } from "@ttoss/ui";
|
|
685
698
|
import * as React4 from "react";
|
|
686
|
-
import { Fragment as Fragment2, jsx as jsx8, jsxs as
|
|
699
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
687
700
|
var AuthSignUp = props => {
|
|
688
701
|
const {
|
|
689
702
|
intl
|
|
@@ -759,7 +772,7 @@ var AuthSignUp = props => {
|
|
|
759
772
|
});
|
|
760
773
|
const termsLinks = props.signUpTerms.terms.map((term, index, terms) => {
|
|
761
774
|
const finalPunctuation = index === terms.length - 1 ? "." : ", ";
|
|
762
|
-
return /* @__PURE__ */
|
|
775
|
+
return /* @__PURE__ */jsxs6(React4.Fragment, {
|
|
763
776
|
children: [/* @__PURE__ */jsx8(Link3, {
|
|
764
777
|
href: term.url,
|
|
765
778
|
target: "_blank",
|
|
@@ -768,7 +781,7 @@ var AuthSignUp = props => {
|
|
|
768
781
|
}, index), finalPunctuation]
|
|
769
782
|
}, index);
|
|
770
783
|
});
|
|
771
|
-
const label = /* @__PURE__ */
|
|
784
|
+
const label = /* @__PURE__ */jsxs6(Text3, {
|
|
772
785
|
children: [signUpTermsFirstMessage, " ", termsLinks]
|
|
773
786
|
});
|
|
774
787
|
return label;
|
|
@@ -802,7 +815,7 @@ var AuthSignUp = props => {
|
|
|
802
815
|
},
|
|
803
816
|
...formMethods,
|
|
804
817
|
onSubmit: onSubmitForm,
|
|
805
|
-
children: /* @__PURE__ */
|
|
818
|
+
children: /* @__PURE__ */jsxs6(AuthCard, {
|
|
806
819
|
buttonLabel: intl.formatMessage({
|
|
807
820
|
id: "URJDrG",
|
|
808
821
|
defaultMessage: [{
|
|
@@ -832,7 +845,7 @@ var AuthSignUp = props => {
|
|
|
832
845
|
}]
|
|
833
846
|
})
|
|
834
847
|
}),
|
|
835
|
-
children: [/* @__PURE__ */
|
|
848
|
+
children: [/* @__PURE__ */jsxs6(Flex4, {
|
|
836
849
|
sx: {
|
|
837
850
|
flexDirection: "column",
|
|
838
851
|
gap: "xl"
|
|
@@ -871,87 +884,18 @@ var AuthSignUp = props => {
|
|
|
871
884
|
};
|
|
872
885
|
|
|
873
886
|
// src/Auth.tsx
|
|
874
|
-
import { jsx as jsx9, jsxs as
|
|
875
|
-
var authMachine = createMachine({
|
|
876
|
-
predictableActionArguments: true,
|
|
877
|
-
initial: "signIn",
|
|
878
|
-
states: {
|
|
879
|
-
signIn: {
|
|
880
|
-
on: {
|
|
881
|
-
SIGN_UP: {
|
|
882
|
-
target: "signUp"
|
|
883
|
-
},
|
|
884
|
-
SIGN_UP_RESEND_CONFIRMATION: {
|
|
885
|
-
actions: ["assignEmail"],
|
|
886
|
-
target: "signUpConfirm"
|
|
887
|
-
},
|
|
888
|
-
FORGOT_PASSWORD: {
|
|
889
|
-
target: "forgotPassword"
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
},
|
|
893
|
-
signUp: {
|
|
894
|
-
on: {
|
|
895
|
-
SIGN_UP_CONFIRM: {
|
|
896
|
-
actions: ["assignEmail"],
|
|
897
|
-
target: "signUpConfirm"
|
|
898
|
-
},
|
|
899
|
-
RETURN_TO_SIGN_IN: {
|
|
900
|
-
target: "signIn"
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
},
|
|
904
|
-
signUpConfirm: {
|
|
905
|
-
on: {
|
|
906
|
-
SIGN_UP_CONFIRMED: {
|
|
907
|
-
actions: ["assignEmail"],
|
|
908
|
-
target: "signIn"
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
},
|
|
912
|
-
forgotPassword: {
|
|
913
|
-
on: {
|
|
914
|
-
RETURN_TO_SIGN_IN: {
|
|
915
|
-
target: "signIn"
|
|
916
|
-
},
|
|
917
|
-
SIGN_UP: {
|
|
918
|
-
target: "signUp"
|
|
919
|
-
},
|
|
920
|
-
FORGOT_PASSWORD_RESET_PASSWORD: {
|
|
921
|
-
actions: ["assignEmail"],
|
|
922
|
-
target: "forgotPasswordResetPassword"
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
},
|
|
926
|
-
forgotPasswordResetPassword: {
|
|
927
|
-
on: {
|
|
928
|
-
FORGOT_PASSWORD_CONFIRMED: {
|
|
929
|
-
actions: ["assignEmail"],
|
|
930
|
-
target: "signIn"
|
|
931
|
-
},
|
|
932
|
-
RETURN_TO_SIGN_IN: {
|
|
933
|
-
target: "signIn"
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
}, {
|
|
939
|
-
actions: {
|
|
940
|
-
assignEmail: assign({
|
|
941
|
-
email: (_, event) => {
|
|
942
|
-
if ("email" in event) {
|
|
943
|
-
return event.email;
|
|
944
|
-
}
|
|
945
|
-
return void 0;
|
|
946
|
-
}
|
|
947
|
-
})
|
|
948
|
-
}
|
|
949
|
-
});
|
|
887
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
950
888
|
var AuthLogic = props => {
|
|
889
|
+
const {
|
|
890
|
+
intl
|
|
891
|
+
} = useI18n6();
|
|
951
892
|
const {
|
|
952
893
|
isAuthenticated
|
|
953
894
|
} = useAuth();
|
|
954
|
-
const [
|
|
895
|
+
const [screen, setScreen] = React5.useState({
|
|
896
|
+
value: "signIn",
|
|
897
|
+
context: {}
|
|
898
|
+
});
|
|
955
899
|
const {
|
|
956
900
|
setLoading,
|
|
957
901
|
addNotification,
|
|
@@ -959,7 +903,7 @@ var AuthLogic = props => {
|
|
|
959
903
|
} = useNotifications2();
|
|
960
904
|
React5.useEffect(() => {
|
|
961
905
|
clearNotifications();
|
|
962
|
-
}, [
|
|
906
|
+
}, [screen.value, clearNotifications]);
|
|
963
907
|
React5.useEffect(() => {
|
|
964
908
|
return clearNotifications;
|
|
965
909
|
}, [clearNotifications]);
|
|
@@ -978,20 +922,30 @@ var AuthLogic = props => {
|
|
|
978
922
|
type: "error",
|
|
979
923
|
message: `For your security, we have updated our system and you need to reset your password in 'forgot your password?' to proceed`
|
|
980
924
|
});
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
send({
|
|
989
|
-
type: "SIGN_UP_RESEND_CONFIRMATION",
|
|
925
|
+
} else if (result.nextStep.signInStep === "CONFIRM_SIGN_UP") {
|
|
926
|
+
await resendSignUpCode({
|
|
927
|
+
username: email
|
|
928
|
+
});
|
|
929
|
+
setScreen({
|
|
930
|
+
value: "signUpResendConfirmation",
|
|
931
|
+
context: {
|
|
990
932
|
email
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
} else if (result.nextStep.signInStep === "DONE") {
|
|
936
|
+
addNotification({
|
|
937
|
+
viewType: "toast",
|
|
938
|
+
type: "success",
|
|
939
|
+
message: intl.formatMessage({
|
|
940
|
+
id: "EO/33N",
|
|
941
|
+
defaultMessage: [{
|
|
942
|
+
"type": 0,
|
|
943
|
+
"value": "Signed in successfully"
|
|
944
|
+
}]
|
|
945
|
+
})
|
|
946
|
+
});
|
|
994
947
|
}
|
|
948
|
+
} catch (error) {
|
|
995
949
|
addNotification({
|
|
996
950
|
type: "error",
|
|
997
951
|
message: error.message
|
|
@@ -999,7 +953,7 @@ var AuthLogic = props => {
|
|
|
999
953
|
} finally {
|
|
1000
954
|
setLoading(false);
|
|
1001
955
|
}
|
|
1002
|
-
}, [
|
|
956
|
+
}, [addNotification, intl, setLoading]);
|
|
1003
957
|
const onSignUp = React5.useCallback(async ({
|
|
1004
958
|
email,
|
|
1005
959
|
password
|
|
@@ -1015,9 +969,11 @@ var AuthLogic = props => {
|
|
|
1015
969
|
}
|
|
1016
970
|
}
|
|
1017
971
|
});
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
972
|
+
setScreen({
|
|
973
|
+
value: "signUpConfirm",
|
|
974
|
+
context: {
|
|
975
|
+
email
|
|
976
|
+
}
|
|
1021
977
|
});
|
|
1022
978
|
} catch (error) {
|
|
1023
979
|
addNotification({
|
|
@@ -1027,7 +983,7 @@ var AuthLogic = props => {
|
|
|
1027
983
|
} finally {
|
|
1028
984
|
setLoading(false);
|
|
1029
985
|
}
|
|
1030
|
-
}, [
|
|
986
|
+
}, [setLoading, addNotification]);
|
|
1031
987
|
const onConfirmSignUp = React5.useCallback(async ({
|
|
1032
988
|
email,
|
|
1033
989
|
code
|
|
@@ -1038,9 +994,11 @@ var AuthLogic = props => {
|
|
|
1038
994
|
confirmationCode: code,
|
|
1039
995
|
username: email
|
|
1040
996
|
});
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
997
|
+
setScreen({
|
|
998
|
+
value: "signIn",
|
|
999
|
+
context: {
|
|
1000
|
+
email
|
|
1001
|
+
}
|
|
1044
1002
|
});
|
|
1045
1003
|
} catch (error) {
|
|
1046
1004
|
addNotification({
|
|
@@ -1050,12 +1008,13 @@ var AuthLogic = props => {
|
|
|
1050
1008
|
} finally {
|
|
1051
1009
|
setLoading(false);
|
|
1052
1010
|
}
|
|
1053
|
-
}, [
|
|
1011
|
+
}, [setLoading, addNotification]);
|
|
1054
1012
|
const onReturnToSignIn = React5.useCallback(() => {
|
|
1055
|
-
|
|
1056
|
-
|
|
1013
|
+
setScreen({
|
|
1014
|
+
value: "signIn",
|
|
1015
|
+
context: {}
|
|
1057
1016
|
});
|
|
1058
|
-
}, [
|
|
1017
|
+
}, []);
|
|
1059
1018
|
const onForgotPassword = React5.useCallback(async ({
|
|
1060
1019
|
email
|
|
1061
1020
|
}) => {
|
|
@@ -1064,9 +1023,11 @@ var AuthLogic = props => {
|
|
|
1064
1023
|
await resetPassword({
|
|
1065
1024
|
username: email
|
|
1066
1025
|
});
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1026
|
+
setScreen({
|
|
1027
|
+
value: "forgotPasswordResetPassword",
|
|
1028
|
+
context: {
|
|
1029
|
+
email
|
|
1030
|
+
}
|
|
1070
1031
|
});
|
|
1071
1032
|
} catch (error) {
|
|
1072
1033
|
addNotification({
|
|
@@ -1076,7 +1037,7 @@ var AuthLogic = props => {
|
|
|
1076
1037
|
} finally {
|
|
1077
1038
|
setLoading(false);
|
|
1078
1039
|
}
|
|
1079
|
-
}, [
|
|
1040
|
+
}, [setLoading, addNotification]);
|
|
1080
1041
|
const onForgotPasswordResetPassword = React5.useCallback(async ({
|
|
1081
1042
|
email,
|
|
1082
1043
|
code,
|
|
@@ -1089,9 +1050,11 @@ var AuthLogic = props => {
|
|
|
1089
1050
|
username: email,
|
|
1090
1051
|
newPassword
|
|
1091
1052
|
});
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1053
|
+
setScreen({
|
|
1054
|
+
value: "signIn",
|
|
1055
|
+
context: {
|
|
1056
|
+
email
|
|
1057
|
+
}
|
|
1095
1058
|
});
|
|
1096
1059
|
} catch (error) {
|
|
1097
1060
|
addNotification({
|
|
@@ -1101,35 +1064,38 @@ var AuthLogic = props => {
|
|
|
1101
1064
|
} finally {
|
|
1102
1065
|
setLoading(false);
|
|
1103
1066
|
}
|
|
1104
|
-
}, [
|
|
1067
|
+
}, [setLoading, addNotification]);
|
|
1105
1068
|
if (isAuthenticated) {
|
|
1106
1069
|
return null;
|
|
1107
1070
|
}
|
|
1108
|
-
if (
|
|
1071
|
+
if (screen.value === "signUp") {
|
|
1109
1072
|
return /* @__PURE__ */jsx9(AuthSignUp, {
|
|
1110
1073
|
onSignUp,
|
|
1111
1074
|
onReturnToSignIn,
|
|
1112
1075
|
signUpTerms: props.signUpTerms
|
|
1113
1076
|
});
|
|
1114
1077
|
}
|
|
1115
|
-
if (
|
|
1078
|
+
if (screen.value === "signUpConfirm" || screen.value === "signUpResendConfirmation") {
|
|
1116
1079
|
return /* @__PURE__ */jsx9(AuthConfirmSignUp, {
|
|
1117
1080
|
onConfirmSignUp,
|
|
1118
|
-
email:
|
|
1081
|
+
email: screen.context.email
|
|
1119
1082
|
});
|
|
1120
1083
|
}
|
|
1121
|
-
if (
|
|
1084
|
+
if (screen.value === "forgotPassword") {
|
|
1122
1085
|
return /* @__PURE__ */jsx9(AuthForgotPassword, {
|
|
1123
1086
|
onForgotPassword,
|
|
1124
1087
|
onCancel: onReturnToSignIn,
|
|
1125
1088
|
onSignUp: () => {
|
|
1126
|
-
|
|
1089
|
+
setScreen({
|
|
1090
|
+
value: "signUp",
|
|
1091
|
+
context: {}
|
|
1092
|
+
});
|
|
1127
1093
|
}
|
|
1128
1094
|
});
|
|
1129
1095
|
}
|
|
1130
|
-
if (
|
|
1096
|
+
if (screen.value === "forgotPasswordResetPassword") {
|
|
1131
1097
|
return /* @__PURE__ */jsx9(AuthForgotPasswordResetPassword, {
|
|
1132
|
-
email:
|
|
1098
|
+
email: screen.context.email,
|
|
1133
1099
|
onForgotPasswordResetPassword,
|
|
1134
1100
|
onCancel: onReturnToSignIn
|
|
1135
1101
|
});
|
|
@@ -1137,13 +1103,19 @@ var AuthLogic = props => {
|
|
|
1137
1103
|
return /* @__PURE__ */jsx9(AuthSignIn, {
|
|
1138
1104
|
onSignIn,
|
|
1139
1105
|
onSignUp: () => {
|
|
1140
|
-
|
|
1106
|
+
setScreen({
|
|
1107
|
+
value: "signUp",
|
|
1108
|
+
context: {}
|
|
1109
|
+
});
|
|
1141
1110
|
},
|
|
1142
1111
|
onForgotPassword: () => {
|
|
1143
|
-
|
|
1112
|
+
setScreen({
|
|
1113
|
+
value: "forgotPassword",
|
|
1114
|
+
context: {}
|
|
1115
|
+
});
|
|
1144
1116
|
},
|
|
1145
1117
|
defaultValues: {
|
|
1146
|
-
email:
|
|
1118
|
+
email: screen.context.email
|
|
1147
1119
|
}
|
|
1148
1120
|
});
|
|
1149
1121
|
};
|
|
@@ -1164,7 +1136,7 @@ var Auth = props => {
|
|
|
1164
1136
|
if (layout.fullScreen) {
|
|
1165
1137
|
if (layout.sideContentPosition) {
|
|
1166
1138
|
return /* @__PURE__ */jsx9(AuthFullScreen, {
|
|
1167
|
-
children: /* @__PURE__ */
|
|
1139
|
+
children: /* @__PURE__ */jsxs7(Flex5, {
|
|
1168
1140
|
sx: {
|
|
1169
1141
|
width: "100%",
|
|
1170
1142
|
height: "100%",
|
package/i18n/compiled/en.json
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"/J+02x": [
|
|
3
|
-
{
|
|
4
|
-
"type": 0,
|
|
5
|
-
"value": "Log in"
|
|
6
|
-
}
|
|
7
|
-
],
|
|
8
2
|
"0XOzcH": [
|
|
9
3
|
{
|
|
10
4
|
"type": 0,
|
|
@@ -73,16 +67,16 @@
|
|
|
73
67
|
"value": " characters"
|
|
74
68
|
}
|
|
75
69
|
],
|
|
76
|
-
"
|
|
70
|
+
"EO/33N": [
|
|
77
71
|
{
|
|
78
72
|
"type": 0,
|
|
79
|
-
"value": "
|
|
73
|
+
"value": "Signed in successfully"
|
|
80
74
|
}
|
|
81
75
|
],
|
|
82
|
-
"
|
|
76
|
+
"EZ3YF2": [
|
|
83
77
|
{
|
|
84
78
|
"type": 0,
|
|
85
|
-
"value": "
|
|
79
|
+
"value": "Sign up"
|
|
86
80
|
}
|
|
87
81
|
],
|
|
88
82
|
"KY2T6J": [
|
|
@@ -135,6 +129,12 @@
|
|
|
135
129
|
"value": "Recovering Password"
|
|
136
130
|
}
|
|
137
131
|
],
|
|
132
|
+
"SQJto2": [
|
|
133
|
+
{
|
|
134
|
+
"type": 0,
|
|
135
|
+
"value": "Sign in"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
138
|
"SnONhb": [
|
|
139
139
|
{
|
|
140
140
|
"type": 0,
|
|
@@ -231,6 +231,12 @@
|
|
|
231
231
|
"value": "Sign up"
|
|
232
232
|
}
|
|
233
233
|
],
|
|
234
|
+
"pwv2cR": [
|
|
235
|
+
{
|
|
236
|
+
"type": 0,
|
|
237
|
+
"value": "We have sent a confirmation code to your email address. Please enter the code below."
|
|
238
|
+
}
|
|
239
|
+
],
|
|
234
240
|
"qnQYqN": [
|
|
235
241
|
{
|
|
236
242
|
"type": 0,
|
package/i18n/lang/en.json
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"/J+02x": {
|
|
3
|
-
"defaultMessage": "Log in",
|
|
4
|
-
"description": "Button label."
|
|
5
|
-
},
|
|
6
2
|
"0XOzcH": {
|
|
7
3
|
"defaultMessage": "Required field",
|
|
8
4
|
"description": "Required field."
|
|
@@ -38,14 +34,13 @@
|
|
|
38
34
|
"Co3exe": {
|
|
39
35
|
"defaultMessage": "By signing up, you agree to the following Terms and Conditions."
|
|
40
36
|
},
|
|
37
|
+
"EO/33N": {
|
|
38
|
+
"defaultMessage": "Signed in successfully"
|
|
39
|
+
},
|
|
41
40
|
"EZ3YF2": {
|
|
42
41
|
"defaultMessage": "Sign up",
|
|
43
42
|
"description": "Sign up"
|
|
44
43
|
},
|
|
45
|
-
"F2iS37": {
|
|
46
|
-
"defaultMessage": "Log in",
|
|
47
|
-
"description": "Sign in title."
|
|
48
|
-
},
|
|
49
44
|
"KY2T6J": {
|
|
50
45
|
"defaultMessage": "Code",
|
|
51
46
|
"description": "Sign up confirmation code"
|
|
@@ -70,6 +65,9 @@
|
|
|
70
65
|
"defaultMessage": "Recovering Password",
|
|
71
66
|
"description": "Recovering Password"
|
|
72
67
|
},
|
|
68
|
+
"SQJto2": {
|
|
69
|
+
"defaultMessage": "Sign in"
|
|
70
|
+
},
|
|
73
71
|
"SnONhb": {
|
|
74
72
|
"defaultMessage": "Please, insert a valid e-mail",
|
|
75
73
|
"description": "Please, insert a valid e-mail"
|
|
@@ -122,6 +120,9 @@
|
|
|
122
120
|
"defaultMessage": "Sign up",
|
|
123
121
|
"description": "Title on sign up."
|
|
124
122
|
},
|
|
123
|
+
"pwv2cR": {
|
|
124
|
+
"defaultMessage": "We have sent a confirmation code to your email address. Please enter the code below."
|
|
125
|
+
},
|
|
125
126
|
"qnQYqN": {
|
|
126
127
|
"defaultMessage": "You must accept the terms and conditions"
|
|
127
128
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/react-auth",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.13",
|
|
4
4
|
"description": "ttoss authentication module for React apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -24,17 +24,14 @@
|
|
|
24
24
|
"i18n"
|
|
25
25
|
],
|
|
26
26
|
"sideEffects": false,
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"@xstate/react": "^3.2.2",
|
|
29
|
-
"xstate": "^4.38.3",
|
|
30
|
-
"@ttoss/forms": "^0.29.6"
|
|
31
|
-
},
|
|
32
27
|
"peerDependencies": {
|
|
33
28
|
"aws-amplify": "^6.0.0",
|
|
34
29
|
"react": ">=16.8.0",
|
|
30
|
+
"@ttoss/forms": "^0.29.7",
|
|
31
|
+
"@ttoss/components": "^2.2.6",
|
|
35
32
|
"@ttoss/react-i18n": "^2.0.10",
|
|
36
|
-
"@ttoss/react-notifications": "^2.1.
|
|
37
|
-
"@ttoss/ui": "^5.5.
|
|
33
|
+
"@ttoss/react-notifications": "^2.1.12",
|
|
34
|
+
"@ttoss/ui": "^5.5.4"
|
|
38
35
|
},
|
|
39
36
|
"devDependencies": {
|
|
40
37
|
"@jest/globals": "^29.7.0",
|
|
@@ -44,12 +41,14 @@
|
|
|
44
41
|
"react": "^19.0.0",
|
|
45
42
|
"tsup": "^8.3.5",
|
|
46
43
|
"@ttoss/cloud-auth": "^0.12.27",
|
|
44
|
+
"@ttoss/components": "^2.2.6",
|
|
45
|
+
"@ttoss/config": "^1.35.2",
|
|
47
46
|
"@ttoss/i18n-cli": "^0.7.27",
|
|
48
47
|
"@ttoss/react-i18n": "^2.0.10",
|
|
49
|
-
"@ttoss/
|
|
50
|
-
"@ttoss/
|
|
48
|
+
"@ttoss/react-notifications": "^2.1.12",
|
|
49
|
+
"@ttoss/forms": "^0.29.7",
|
|
51
50
|
"@ttoss/test-utils": "^2.1.22",
|
|
52
|
-
"@ttoss/ui": "^5.5.
|
|
51
|
+
"@ttoss/ui": "^5.5.4"
|
|
53
52
|
},
|
|
54
53
|
"keywords": [
|
|
55
54
|
"React",
|