@ttoss/react-auth-core 0.4.31 → 0.4.33
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/index.cjs +19 -19
- package/dist/index.mjs +19 -19
- package/package.json +16 -16
package/dist/index.cjs
CHANGED
|
@@ -42,8 +42,8 @@ let _ttoss_logger = require("@ttoss/logger");
|
|
|
42
42
|
let react_error_boundary = require("react-error-boundary");
|
|
43
43
|
|
|
44
44
|
//#region src/AuthCard.tsx
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
var LogoContext = react.createContext({});
|
|
46
|
+
var LogoProvider = ({
|
|
47
47
|
children,
|
|
48
48
|
...values
|
|
49
49
|
}) => {
|
|
@@ -52,7 +52,7 @@ const LogoProvider = ({
|
|
|
52
52
|
children
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
var AuthCard = ({
|
|
56
56
|
children,
|
|
57
57
|
title,
|
|
58
58
|
buttonLabel,
|
|
@@ -119,7 +119,7 @@ const AuthCard = ({
|
|
|
119
119
|
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/AuthConfirmSignUpCheckEmail.tsx
|
|
122
|
-
|
|
122
|
+
var AuthConfirmSignUpCheckEmail = ({
|
|
123
123
|
onConfirmSignUpCheckEmail
|
|
124
124
|
}) => {
|
|
125
125
|
const {
|
|
@@ -162,7 +162,7 @@ const AuthConfirmSignUpCheckEmail = ({
|
|
|
162
162
|
|
|
163
163
|
//#endregion
|
|
164
164
|
//#region src/AuthConfirmSignUpWithCode.tsx
|
|
165
|
-
|
|
165
|
+
var AuthConfirmSignUpWithCode = ({
|
|
166
166
|
email,
|
|
167
167
|
onConfirmSignUpWithCode
|
|
168
168
|
}) => {
|
|
@@ -248,7 +248,7 @@ const AuthConfirmSignUpWithCode = ({
|
|
|
248
248
|
|
|
249
249
|
//#endregion
|
|
250
250
|
//#region src/AuthForgotPassword.tsx
|
|
251
|
-
|
|
251
|
+
var AuthForgotPassword = props => {
|
|
252
252
|
const {
|
|
253
253
|
intl
|
|
254
254
|
} = (0, _ttoss_react_i18n.useI18n)();
|
|
@@ -337,7 +337,7 @@ const AuthForgotPassword = props => {
|
|
|
337
337
|
|
|
338
338
|
//#endregion
|
|
339
339
|
//#region src/AuthForgotPasswordResetPassword.tsx
|
|
340
|
-
|
|
340
|
+
var AuthForgotPasswordResetPassword = props => {
|
|
341
341
|
const {
|
|
342
342
|
intl
|
|
343
343
|
} = (0, _ttoss_react_i18n.useI18n)();
|
|
@@ -475,7 +475,7 @@ const AuthForgotPasswordResetPassword = props => {
|
|
|
475
475
|
|
|
476
476
|
//#endregion
|
|
477
477
|
//#region src/AuthFullScreen.tsx
|
|
478
|
-
|
|
478
|
+
var AuthFullScreen = ({
|
|
479
479
|
children
|
|
480
480
|
}) => {
|
|
481
481
|
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(_ttoss_ui.Flex, {
|
|
@@ -495,7 +495,7 @@ const AuthFullScreen = ({
|
|
|
495
495
|
|
|
496
496
|
//#endregion
|
|
497
497
|
//#region src/AuthSignIn.tsx
|
|
498
|
-
|
|
498
|
+
var AuthSignIn = ({
|
|
499
499
|
onSignIn,
|
|
500
500
|
onGoToSignUp,
|
|
501
501
|
defaultValues,
|
|
@@ -638,7 +638,7 @@ const AuthSignIn = ({
|
|
|
638
638
|
|
|
639
639
|
//#endregion
|
|
640
640
|
//#region src/AuthSignUp.tsx
|
|
641
|
-
|
|
641
|
+
var AuthSignUp = props => {
|
|
642
642
|
const {
|
|
643
643
|
intl
|
|
644
644
|
} = (0, _ttoss_react_i18n.useI18n)();
|
|
@@ -818,7 +818,7 @@ const AuthSignUp = props => {
|
|
|
818
818
|
|
|
819
819
|
//#endregion
|
|
820
820
|
//#region src/ErrorBoundary.tsx
|
|
821
|
-
|
|
821
|
+
var ErrorFallback = ({
|
|
822
822
|
resetErrorBoundary
|
|
823
823
|
}) => {
|
|
824
824
|
const {
|
|
@@ -839,7 +839,7 @@ const ErrorFallback = ({
|
|
|
839
839
|
})
|
|
840
840
|
});
|
|
841
841
|
};
|
|
842
|
-
|
|
842
|
+
var ErrorBoundary = ({
|
|
843
843
|
children
|
|
844
844
|
}) => {
|
|
845
845
|
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_error_boundary.ErrorBoundary, {
|
|
@@ -857,7 +857,7 @@ const ErrorBoundary = ({
|
|
|
857
857
|
|
|
858
858
|
//#endregion
|
|
859
859
|
//#region src/useAuthScreen.ts
|
|
860
|
-
|
|
860
|
+
var useAuthScreen = initialScreen => {
|
|
861
861
|
const [screen, setScreen] = react$1.useState(initialScreen || {
|
|
862
862
|
value: "signIn"
|
|
863
863
|
});
|
|
@@ -869,7 +869,7 @@ const useAuthScreen = initialScreen => {
|
|
|
869
869
|
|
|
870
870
|
//#endregion
|
|
871
871
|
//#region src/Auth.tsx
|
|
872
|
-
|
|
872
|
+
var AuthLogic = props => {
|
|
873
873
|
const {
|
|
874
874
|
screen,
|
|
875
875
|
setScreen,
|
|
@@ -959,7 +959,7 @@ const AuthLogic = props => {
|
|
|
959
959
|
});
|
|
960
960
|
return null;
|
|
961
961
|
};
|
|
962
|
-
|
|
962
|
+
var Auth = props => {
|
|
963
963
|
const {
|
|
964
964
|
layout = {
|
|
965
965
|
fullScreen: true
|
|
@@ -1026,13 +1026,13 @@ const Auth = props => {
|
|
|
1026
1026
|
|
|
1027
1027
|
//#endregion
|
|
1028
1028
|
//#region src/AuthProvider.tsx
|
|
1029
|
-
|
|
1030
|
-
|
|
1029
|
+
var AuthContext = react.createContext(null);
|
|
1030
|
+
var UNAUTHENTICATED_USER = {
|
|
1031
1031
|
user: null,
|
|
1032
1032
|
tokens: null,
|
|
1033
1033
|
isAuthenticated: false
|
|
1034
1034
|
};
|
|
1035
|
-
|
|
1035
|
+
var AuthProvider = props => {
|
|
1036
1036
|
const {
|
|
1037
1037
|
getAuthData,
|
|
1038
1038
|
signOut: signOutProp
|
|
@@ -1081,7 +1081,7 @@ const AuthProvider = props => {
|
|
|
1081
1081
|
children: props.children
|
|
1082
1082
|
});
|
|
1083
1083
|
};
|
|
1084
|
-
|
|
1084
|
+
var useAuth = () => {
|
|
1085
1085
|
const context = react.useContext(AuthContext);
|
|
1086
1086
|
if (!context) throw new Error("useAuth must be used within an AuthProvider");
|
|
1087
1087
|
return context;
|
package/dist/index.mjs
CHANGED
|
@@ -10,8 +10,8 @@ import { notify } from "@ttoss/logger";
|
|
|
10
10
|
import { ErrorBoundary as ErrorBoundary$1 } from "react-error-boundary";
|
|
11
11
|
|
|
12
12
|
//#region src/AuthCard.tsx
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var LogoContext = React.createContext({});
|
|
14
|
+
var LogoProvider = ({
|
|
15
15
|
children,
|
|
16
16
|
...values
|
|
17
17
|
}) => {
|
|
@@ -20,7 +20,7 @@ const LogoProvider = ({
|
|
|
20
20
|
children
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
var AuthCard = ({
|
|
24
24
|
children,
|
|
25
25
|
title,
|
|
26
26
|
buttonLabel,
|
|
@@ -87,7 +87,7 @@ const AuthCard = ({
|
|
|
87
87
|
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/AuthConfirmSignUpCheckEmail.tsx
|
|
90
|
-
|
|
90
|
+
var AuthConfirmSignUpCheckEmail = ({
|
|
91
91
|
onConfirmSignUpCheckEmail
|
|
92
92
|
}) => {
|
|
93
93
|
const {
|
|
@@ -130,7 +130,7 @@ const AuthConfirmSignUpCheckEmail = ({
|
|
|
130
130
|
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region src/AuthConfirmSignUpWithCode.tsx
|
|
133
|
-
|
|
133
|
+
var AuthConfirmSignUpWithCode = ({
|
|
134
134
|
email,
|
|
135
135
|
onConfirmSignUpWithCode
|
|
136
136
|
}) => {
|
|
@@ -216,7 +216,7 @@ const AuthConfirmSignUpWithCode = ({
|
|
|
216
216
|
|
|
217
217
|
//#endregion
|
|
218
218
|
//#region src/AuthForgotPassword.tsx
|
|
219
|
-
|
|
219
|
+
var AuthForgotPassword = props => {
|
|
220
220
|
const {
|
|
221
221
|
intl
|
|
222
222
|
} = useI18n();
|
|
@@ -305,7 +305,7 @@ const AuthForgotPassword = props => {
|
|
|
305
305
|
|
|
306
306
|
//#endregion
|
|
307
307
|
//#region src/AuthForgotPasswordResetPassword.tsx
|
|
308
|
-
|
|
308
|
+
var AuthForgotPasswordResetPassword = props => {
|
|
309
309
|
const {
|
|
310
310
|
intl
|
|
311
311
|
} = useI18n();
|
|
@@ -443,7 +443,7 @@ const AuthForgotPasswordResetPassword = props => {
|
|
|
443
443
|
|
|
444
444
|
//#endregion
|
|
445
445
|
//#region src/AuthFullScreen.tsx
|
|
446
|
-
|
|
446
|
+
var AuthFullScreen = ({
|
|
447
447
|
children
|
|
448
448
|
}) => {
|
|
449
449
|
return /* @__PURE__ */jsx(Flex, {
|
|
@@ -463,7 +463,7 @@ const AuthFullScreen = ({
|
|
|
463
463
|
|
|
464
464
|
//#endregion
|
|
465
465
|
//#region src/AuthSignIn.tsx
|
|
466
|
-
|
|
466
|
+
var AuthSignIn = ({
|
|
467
467
|
onSignIn,
|
|
468
468
|
onGoToSignUp,
|
|
469
469
|
defaultValues,
|
|
@@ -606,7 +606,7 @@ const AuthSignIn = ({
|
|
|
606
606
|
|
|
607
607
|
//#endregion
|
|
608
608
|
//#region src/AuthSignUp.tsx
|
|
609
|
-
|
|
609
|
+
var AuthSignUp = props => {
|
|
610
610
|
const {
|
|
611
611
|
intl
|
|
612
612
|
} = useI18n();
|
|
@@ -786,7 +786,7 @@ const AuthSignUp = props => {
|
|
|
786
786
|
|
|
787
787
|
//#endregion
|
|
788
788
|
//#region src/ErrorBoundary.tsx
|
|
789
|
-
|
|
789
|
+
var ErrorFallback = ({
|
|
790
790
|
resetErrorBoundary
|
|
791
791
|
}) => {
|
|
792
792
|
const {
|
|
@@ -807,7 +807,7 @@ const ErrorFallback = ({
|
|
|
807
807
|
})
|
|
808
808
|
});
|
|
809
809
|
};
|
|
810
|
-
|
|
810
|
+
var ErrorBoundary = ({
|
|
811
811
|
children
|
|
812
812
|
}) => {
|
|
813
813
|
return /* @__PURE__ */jsx(ErrorBoundary$1, {
|
|
@@ -825,7 +825,7 @@ const ErrorBoundary = ({
|
|
|
825
825
|
|
|
826
826
|
//#endregion
|
|
827
827
|
//#region src/useAuthScreen.ts
|
|
828
|
-
|
|
828
|
+
var useAuthScreen = initialScreen => {
|
|
829
829
|
const [screen, setScreen] = React.useState(initialScreen || {
|
|
830
830
|
value: "signIn"
|
|
831
831
|
});
|
|
@@ -837,7 +837,7 @@ const useAuthScreen = initialScreen => {
|
|
|
837
837
|
|
|
838
838
|
//#endregion
|
|
839
839
|
//#region src/Auth.tsx
|
|
840
|
-
|
|
840
|
+
var AuthLogic = props => {
|
|
841
841
|
const {
|
|
842
842
|
screen,
|
|
843
843
|
setScreen,
|
|
@@ -927,7 +927,7 @@ const AuthLogic = props => {
|
|
|
927
927
|
});
|
|
928
928
|
return null;
|
|
929
929
|
};
|
|
930
|
-
|
|
930
|
+
var Auth = props => {
|
|
931
931
|
const {
|
|
932
932
|
layout = {
|
|
933
933
|
fullScreen: true
|
|
@@ -994,13 +994,13 @@ const Auth = props => {
|
|
|
994
994
|
|
|
995
995
|
//#endregion
|
|
996
996
|
//#region src/AuthProvider.tsx
|
|
997
|
-
|
|
998
|
-
|
|
997
|
+
var AuthContext = React.createContext(null);
|
|
998
|
+
var UNAUTHENTICATED_USER = {
|
|
999
999
|
user: null,
|
|
1000
1000
|
tokens: null,
|
|
1001
1001
|
isAuthenticated: false
|
|
1002
1002
|
};
|
|
1003
|
-
|
|
1003
|
+
var AuthProvider = props => {
|
|
1004
1004
|
const {
|
|
1005
1005
|
getAuthData,
|
|
1006
1006
|
signOut: signOutProp
|
|
@@ -1049,7 +1049,7 @@ const AuthProvider = props => {
|
|
|
1049
1049
|
children: props.children
|
|
1050
1050
|
});
|
|
1051
1051
|
};
|
|
1052
|
-
|
|
1052
|
+
var useAuth = () => {
|
|
1053
1053
|
const context = React.useContext(AuthContext);
|
|
1054
1054
|
if (!context) throw new Error("useAuth must be used within an AuthProvider");
|
|
1055
1055
|
return context;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/react-auth-core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.33",
|
|
4
4
|
"description": "Core authentication components and abstractions for React apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"React",
|
|
@@ -39,24 +39,24 @@
|
|
|
39
39
|
"jest": "^30.3.0",
|
|
40
40
|
"react": "^19.2.6",
|
|
41
41
|
"tsdown": "^0.22.0",
|
|
42
|
-
"@ttoss/
|
|
43
|
-
"@ttoss/
|
|
44
|
-
"@ttoss/
|
|
45
|
-
"@ttoss/logger": "^0.8.
|
|
46
|
-
"@ttoss/react-i18n": "^2.2.
|
|
47
|
-
"@ttoss/
|
|
48
|
-
"@ttoss/
|
|
49
|
-
"@ttoss/
|
|
50
|
-
"@ttoss/test-utils": "^4.2.
|
|
42
|
+
"@ttoss/forms": "^0.43.28",
|
|
43
|
+
"@ttoss/i18n-cli": "^0.8.15",
|
|
44
|
+
"@ttoss/config": "^1.37.15",
|
|
45
|
+
"@ttoss/logger": "^0.8.16",
|
|
46
|
+
"@ttoss/react-i18n": "^2.2.17",
|
|
47
|
+
"@ttoss/components": "^2.14.24",
|
|
48
|
+
"@ttoss/react-notifications": "^2.7.24",
|
|
49
|
+
"@ttoss/ui": "^6.9.23",
|
|
50
|
+
"@ttoss/test-utils": "^4.2.15"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": ">=16.8.0",
|
|
54
|
-
"@ttoss/
|
|
55
|
-
"@ttoss/logger": "^0.8.
|
|
56
|
-
"@ttoss/react-i18n": "^2.2.
|
|
57
|
-
"@ttoss/
|
|
58
|
-
"@ttoss/
|
|
59
|
-
"@ttoss/
|
|
54
|
+
"@ttoss/forms": "^0.43.28",
|
|
55
|
+
"@ttoss/logger": "^0.8.16",
|
|
56
|
+
"@ttoss/react-i18n": "^2.2.17",
|
|
57
|
+
"@ttoss/react-notifications": "^2.7.24",
|
|
58
|
+
"@ttoss/components": "^2.14.24",
|
|
59
|
+
"@ttoss/ui": "^6.9.23"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public",
|