@ttoss/react-auth 2.6.29 → 2.6.31
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/README.md +97 -131
- package/dist/esm/index.js +97 -1090
- package/dist/index.d.ts +11 -101
- package/i18n/compiled/en.json +36 -10
- package/i18n/lang/en.json +60 -13
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,108 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { AuthProps as AuthProps$1, AuthData } from '@ttoss/react-auth-core';
|
|
3
|
+
export { useAuth } from '@ttoss/react-auth-core';
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
|
|
4
|
-
type
|
|
5
|
-
logo?: React.ReactNode;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type OnSignInInput = {
|
|
10
|
-
email: string;
|
|
11
|
-
password: string;
|
|
12
|
-
};
|
|
13
|
-
type OnSignIn = (input: OnSignInInput) => void;
|
|
14
|
-
type OnSignUpInput = {
|
|
15
|
-
email: string;
|
|
16
|
-
password: string;
|
|
17
|
-
confirmPassword: string;
|
|
18
|
-
signUpTerms?: boolean;
|
|
19
|
-
};
|
|
20
|
-
type OnSignUp = (input: OnSignUpInput) => void;
|
|
21
|
-
type OnConfirmSignUp = (input: {
|
|
22
|
-
email: string;
|
|
23
|
-
code: string;
|
|
24
|
-
}) => void;
|
|
25
|
-
type OnForgotPassword = (input: {
|
|
26
|
-
email: string;
|
|
27
|
-
}) => void;
|
|
28
|
-
type OnForgotPasswordResetPassword = (input: {
|
|
29
|
-
email: string;
|
|
30
|
-
code: string;
|
|
31
|
-
newPassword: string;
|
|
32
|
-
}) => void;
|
|
33
|
-
|
|
34
|
-
type AuthSignUpProps = {
|
|
35
|
-
onSignUp: OnSignUp;
|
|
36
|
-
onReturnToSignIn: () => void;
|
|
37
|
-
signUpTerms?: {
|
|
38
|
-
isRequired: boolean;
|
|
39
|
-
terms: {
|
|
40
|
-
label: string;
|
|
41
|
-
url: string;
|
|
42
|
-
}[];
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
type AuthLogicProps = {
|
|
47
|
-
signUpTerms?: AuthSignUpProps['signUpTerms'];
|
|
48
|
-
};
|
|
49
|
-
type AuthLayout = {
|
|
50
|
-
fullScreen?: boolean;
|
|
51
|
-
sideContent?: React.ReactNode;
|
|
52
|
-
sideContentPosition?: 'left' | 'right';
|
|
53
|
-
};
|
|
54
|
-
type AuthProps = LogoContextProps & AuthLogicProps & {
|
|
55
|
-
layout?: AuthLayout;
|
|
56
|
-
};
|
|
6
|
+
type AuthProps = Pick<AuthProps$1, 'signUpTerms' | 'logo' | 'layout'>;
|
|
57
7
|
declare const Auth: (props: AuthProps) => react_jsx_runtime.JSX.Element;
|
|
58
8
|
|
|
59
|
-
|
|
60
|
-
id: string;
|
|
61
|
-
email: string;
|
|
62
|
-
emailVerified: string;
|
|
63
|
-
} | null;
|
|
64
|
-
type Tokens = {
|
|
65
|
-
idToken: string;
|
|
66
|
-
accessToken: string;
|
|
67
|
-
refreshToken: string;
|
|
68
|
-
} | null;
|
|
69
|
-
type AuthScreen = {
|
|
70
|
-
value: 'signIn';
|
|
71
|
-
context: {
|
|
72
|
-
email?: string;
|
|
73
|
-
};
|
|
74
|
-
} | {
|
|
75
|
-
value: 'signUp';
|
|
76
|
-
context: Record<string, never>;
|
|
77
|
-
} | {
|
|
78
|
-
value: 'signUpConfirm';
|
|
79
|
-
context: {
|
|
80
|
-
email: string;
|
|
81
|
-
};
|
|
82
|
-
} | {
|
|
83
|
-
value: 'signUpResendConfirmation';
|
|
84
|
-
context: {
|
|
85
|
-
email: string;
|
|
86
|
-
};
|
|
87
|
-
} | {
|
|
88
|
-
value: 'forgotPassword';
|
|
89
|
-
context: Record<string, never>;
|
|
90
|
-
} | {
|
|
91
|
-
value: 'forgotPasswordResetPassword';
|
|
92
|
-
context: {
|
|
93
|
-
email: string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
declare const AuthProvider: ({ children }: {
|
|
9
|
+
declare const AuthProvider: (props: {
|
|
97
10
|
children: React.ReactNode;
|
|
98
|
-
}) => react_jsx_runtime.JSX.Element
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
screen: AuthScreen;
|
|
105
|
-
setScreen: React.Dispatch<React.SetStateAction<AuthScreen>>;
|
|
106
|
-
};
|
|
11
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
declare const getAuthData: ({ includeTokens, }?: {
|
|
14
|
+
includeTokens?: boolean;
|
|
15
|
+
}) => Promise<AuthData | null>;
|
|
16
|
+
declare const checkAuth: () => Promise<boolean>;
|
|
107
17
|
|
|
108
|
-
export { Auth, type AuthProps, AuthProvider,
|
|
18
|
+
export { Auth, type AuthProps, AuthProvider, checkAuth, getAuthData };
|
package/i18n/compiled/en.json
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"value": "Required field"
|
|
6
6
|
}
|
|
7
7
|
],
|
|
8
|
-
"
|
|
8
|
+
"38HSjr": [
|
|
9
9
|
{
|
|
10
10
|
"type": 0,
|
|
11
|
-
"value": "
|
|
11
|
+
"value": "Sign In"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"5E12mO": [
|
|
@@ -17,12 +17,6 @@
|
|
|
17
17
|
"value": "Email"
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
|
-
"5oOshZ": [
|
|
21
|
-
{
|
|
22
|
-
"type": 0,
|
|
23
|
-
"value": "Enter your email address"
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
20
|
"6PdOcy": [
|
|
27
21
|
{
|
|
28
22
|
"type": 0,
|
|
@@ -79,6 +73,12 @@
|
|
|
79
73
|
"value": "Sign up"
|
|
80
74
|
}
|
|
81
75
|
],
|
|
76
|
+
"HT4tSM": [
|
|
77
|
+
{
|
|
78
|
+
"type": 0,
|
|
79
|
+
"value": "Reset Password"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
82
|
"KY2T6J": [
|
|
83
83
|
{
|
|
84
84
|
"type": 0,
|
|
@@ -135,10 +135,18 @@
|
|
|
135
135
|
"value": "Sign in"
|
|
136
136
|
}
|
|
137
137
|
],
|
|
138
|
-
"
|
|
138
|
+
"SfWKyS": [
|
|
139
139
|
{
|
|
140
140
|
"type": 0,
|
|
141
|
-
"value": "
|
|
141
|
+
"value": "Maximum "
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"type": 1,
|
|
145
|
+
"value": "value"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"type": 0,
|
|
149
|
+
"value": " characters"
|
|
142
150
|
}
|
|
143
151
|
],
|
|
144
152
|
"TZ4WUk": [
|
|
@@ -201,6 +209,12 @@
|
|
|
201
209
|
"value": "Enter your email address"
|
|
202
210
|
}
|
|
203
211
|
],
|
|
212
|
+
"e3IQoc": [
|
|
213
|
+
{
|
|
214
|
+
"type": 0,
|
|
215
|
+
"value": "New Password"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
204
218
|
"kdFYba": [
|
|
205
219
|
{
|
|
206
220
|
"type": 0,
|
|
@@ -243,10 +257,22 @@
|
|
|
243
257
|
"value": "We have sent a confirmation code to your email address. Please enter the code below."
|
|
244
258
|
}
|
|
245
259
|
],
|
|
260
|
+
"qTQ4hP": [
|
|
261
|
+
{
|
|
262
|
+
"type": 0,
|
|
263
|
+
"value": "An email has been sent to your address. Please check your inbox and follow the instructions to confirm your sign up."
|
|
264
|
+
}
|
|
265
|
+
],
|
|
246
266
|
"qnQYqN": [
|
|
247
267
|
{
|
|
248
268
|
"type": 0,
|
|
249
269
|
"value": "You must accept the terms and conditions"
|
|
250
270
|
}
|
|
271
|
+
],
|
|
272
|
+
"s1OmP0": [
|
|
273
|
+
{
|
|
274
|
+
"type": 0,
|
|
275
|
+
"value": "Confirmation code"
|
|
276
|
+
}
|
|
251
277
|
]
|
|
252
278
|
}
|
package/i18n/lang/en.json
CHANGED
|
@@ -1,134 +1,181 @@
|
|
|
1
1
|
{
|
|
2
|
+
"EO/33N": {
|
|
3
|
+
"defaultMessage": "Signed in successfully"
|
|
4
|
+
},
|
|
2
5
|
"0XOzcH": {
|
|
6
|
+
"module": "@ttoss/react-auth-core",
|
|
3
7
|
"defaultMessage": "Required field",
|
|
4
8
|
"description": "Required field."
|
|
5
9
|
},
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
10
|
+
"38HSjr": {
|
|
11
|
+
"module": "@ttoss/react-auth-core",
|
|
12
|
+
"defaultMessage": "Sign In",
|
|
13
|
+
"description": "Sign In"
|
|
9
14
|
},
|
|
10
15
|
"5E12mO": {
|
|
16
|
+
"module": "@ttoss/react-auth-core",
|
|
11
17
|
"defaultMessage": "Email",
|
|
12
18
|
"description": "Email label."
|
|
13
19
|
},
|
|
14
|
-
"5oOshZ": {
|
|
15
|
-
"defaultMessage": "Enter your email address",
|
|
16
|
-
"description": "Required field."
|
|
17
|
-
},
|
|
18
20
|
"6PdOcy": {
|
|
21
|
+
"module": "@ttoss/react-auth-core",
|
|
19
22
|
"defaultMessage": "Cancel",
|
|
20
23
|
"description": "Cancel"
|
|
21
24
|
},
|
|
22
25
|
"8GMUPk": {
|
|
26
|
+
"module": "@ttoss/react-auth-core",
|
|
23
27
|
"defaultMessage": "I'm already registered",
|
|
24
28
|
"description": "Link to sign in on sign up."
|
|
25
29
|
},
|
|
26
30
|
"9cApwd": {
|
|
31
|
+
"module": "@ttoss/react-auth-core",
|
|
27
32
|
"defaultMessage": "Please, insert a valid e-mail",
|
|
28
33
|
"description": "Invalid email."
|
|
29
34
|
},
|
|
30
35
|
"BtK6KR": {
|
|
36
|
+
"module": "@ttoss/react-auth-core",
|
|
31
37
|
"defaultMessage": "Forgot password?",
|
|
32
38
|
"description": "Forgot password?"
|
|
33
39
|
},
|
|
34
40
|
"Co3exe": {
|
|
41
|
+
"module": "@ttoss/react-auth-core",
|
|
35
42
|
"defaultMessage": "By signing up, you agree to the following Terms and Conditions."
|
|
36
43
|
},
|
|
37
|
-
"EO/33N": {
|
|
38
|
-
"defaultMessage": "Signed in successfully"
|
|
39
|
-
},
|
|
40
44
|
"EZ3YF2": {
|
|
45
|
+
"module": "@ttoss/react-auth-core",
|
|
41
46
|
"defaultMessage": "Sign up",
|
|
42
47
|
"description": "Sign up"
|
|
43
48
|
},
|
|
49
|
+
"HT4tSM": {
|
|
50
|
+
"module": "@ttoss/react-auth-core",
|
|
51
|
+
"defaultMessage": "Reset Password",
|
|
52
|
+
"description": "Reset Password"
|
|
53
|
+
},
|
|
44
54
|
"KY2T6J": {
|
|
55
|
+
"module": "@ttoss/react-auth-core",
|
|
45
56
|
"defaultMessage": "Code",
|
|
46
57
|
"description": "Sign up confirmation code"
|
|
47
58
|
},
|
|
48
59
|
"NJ57Qj": {
|
|
60
|
+
"module": "@ttoss/react-auth-core",
|
|
49
61
|
"defaultMessage": "Confirm password field is required",
|
|
50
62
|
"description": "Confirm Password is required."
|
|
51
63
|
},
|
|
52
64
|
"OhDL0i": {
|
|
65
|
+
"module": "@ttoss/react-auth-core",
|
|
53
66
|
"defaultMessage": "Invalid email",
|
|
54
67
|
"description": "Invalid email."
|
|
55
68
|
},
|
|
56
69
|
"PylVqx": {
|
|
70
|
+
"module": "@ttoss/react-auth-core",
|
|
57
71
|
"defaultMessage": "Password",
|
|
58
72
|
"description": "Password label."
|
|
59
73
|
},
|
|
60
74
|
"S3pjKw": {
|
|
75
|
+
"module": "@ttoss/react-auth-core",
|
|
61
76
|
"defaultMessage": "Minimum {value} characters",
|
|
62
77
|
"description": "Minimum {value} characters."
|
|
63
78
|
},
|
|
64
79
|
"S4bbEj": {
|
|
80
|
+
"module": "@ttoss/react-auth-core",
|
|
65
81
|
"defaultMessage": "Recovering Password",
|
|
66
82
|
"description": "Recovering Password"
|
|
67
83
|
},
|
|
68
84
|
"SQJto2": {
|
|
85
|
+
"module": "@ttoss/react-auth-core",
|
|
69
86
|
"defaultMessage": "Sign in"
|
|
70
87
|
},
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
88
|
+
"SfWKyS": {
|
|
89
|
+
"module": "@ttoss/react-auth-core",
|
|
90
|
+
"defaultMessage": "Maximum {value} characters",
|
|
91
|
+
"description": "Maximum {value} characters."
|
|
74
92
|
},
|
|
75
93
|
"TZ4WUk": {
|
|
94
|
+
"module": "@ttoss/react-auth-core",
|
|
76
95
|
"defaultMessage": "Password requires {value} characters",
|
|
77
96
|
"description": "Password must be at least {value} characters long."
|
|
78
97
|
},
|
|
79
98
|
"UNttd+": {
|
|
99
|
+
"module": "@ttoss/react-auth-core",
|
|
80
100
|
"defaultMessage": "Confirm",
|
|
81
101
|
"description": "Confirm"
|
|
82
102
|
},
|
|
83
103
|
"URJDrG": {
|
|
104
|
+
"module": "@ttoss/react-auth-core",
|
|
84
105
|
"defaultMessage": "Sign up",
|
|
85
106
|
"description": "Create account."
|
|
86
107
|
},
|
|
87
108
|
"WU/CqP": {
|
|
109
|
+
"module": "@ttoss/react-auth-core",
|
|
88
110
|
"defaultMessage": "Passwords are not the same",
|
|
89
111
|
"description": "Passwords are not the same"
|
|
90
112
|
},
|
|
91
113
|
"XreZg+": {
|
|
114
|
+
"module": "@ttoss/react-auth-core",
|
|
92
115
|
"defaultMessage": "Registered Email",
|
|
93
116
|
"description": "Registered Email"
|
|
94
117
|
},
|
|
95
118
|
"cGR2eI": {
|
|
119
|
+
"module": "@ttoss/react-auth-core",
|
|
96
120
|
"defaultMessage": "Confirmation",
|
|
97
121
|
"description": "Confirmation"
|
|
98
122
|
},
|
|
99
123
|
"d1YCuH": {
|
|
124
|
+
"module": "@ttoss/react-auth-core",
|
|
100
125
|
"defaultMessage": "Enter your email address",
|
|
101
126
|
"description": "Email is a required field."
|
|
102
127
|
},
|
|
128
|
+
"e3IQoc": {
|
|
129
|
+
"module": "@ttoss/react-auth-core",
|
|
130
|
+
"defaultMessage": "New Password",
|
|
131
|
+
"description": "New Password"
|
|
132
|
+
},
|
|
103
133
|
"kdFYba": {
|
|
134
|
+
"module": "@ttoss/react-auth-core",
|
|
104
135
|
"defaultMessage": "Password field is required",
|
|
105
136
|
"description": "Password is required."
|
|
106
137
|
},
|
|
107
138
|
"khMx/2": {
|
|
139
|
+
"module": "@ttoss/react-auth-core",
|
|
108
140
|
"defaultMessage": "An error occurred with your authentication. Please try again."
|
|
109
141
|
},
|
|
110
142
|
"lY+cuM": {
|
|
143
|
+
"module": "@ttoss/react-auth-core",
|
|
111
144
|
"defaultMessage": "Confirm password",
|
|
112
145
|
"description": "Confirm Password label."
|
|
113
146
|
},
|
|
114
147
|
"lZvoYL": {
|
|
148
|
+
"module": "@ttoss/react-auth-core",
|
|
115
149
|
"defaultMessage": "Sign up now",
|
|
116
150
|
"description": "Sign up now"
|
|
117
151
|
},
|
|
118
152
|
"mZzmNV": {
|
|
153
|
+
"module": "@ttoss/react-auth-core",
|
|
119
154
|
"defaultMessage": "Recover Password",
|
|
120
155
|
"description": "Recover Password"
|
|
121
156
|
},
|
|
122
157
|
"oayEC3": {
|
|
158
|
+
"module": "@ttoss/react-auth-core",
|
|
123
159
|
"defaultMessage": "Sign up",
|
|
124
160
|
"description": "Title on sign up."
|
|
125
161
|
},
|
|
126
162
|
"pwv2cR": {
|
|
163
|
+
"module": "@ttoss/react-auth-core",
|
|
127
164
|
"defaultMessage": "We have sent a confirmation code to your email address. Please enter the code below."
|
|
128
165
|
},
|
|
166
|
+
"qTQ4hP": {
|
|
167
|
+
"module": "@ttoss/react-auth-core",
|
|
168
|
+
"defaultMessage": "An email has been sent to your address. Please check your inbox and follow the instructions to confirm your sign up."
|
|
169
|
+
},
|
|
129
170
|
"qnQYqN": {
|
|
171
|
+
"module": "@ttoss/react-auth-core",
|
|
130
172
|
"defaultMessage": "You must accept the terms and conditions"
|
|
131
173
|
},
|
|
174
|
+
"s1OmP0": {
|
|
175
|
+
"module": "@ttoss/react-auth-core",
|
|
176
|
+
"defaultMessage": "Confirmation code",
|
|
177
|
+
"description": "Confirmation code"
|
|
178
|
+
},
|
|
132
179
|
"D1C6fR": {
|
|
133
180
|
"module": "@ttoss/forms",
|
|
134
181
|
"defaultMessage": "Field must be at least {min} characters",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/react-auth",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.31",
|
|
4
4
|
"description": "ttoss authentication module for React apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -25,15 +25,16 @@
|
|
|
25
25
|
],
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"react-error-boundary": "^5.0.0"
|
|
28
|
+
"react-error-boundary": "^5.0.0",
|
|
29
|
+
"@ttoss/react-auth-core": "^0.2.2"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {
|
|
31
32
|
"aws-amplify": "^6.0.0",
|
|
32
33
|
"react": ">=16.8.0",
|
|
33
34
|
"@ttoss/components": "^2.2.26",
|
|
34
|
-
"@ttoss/forms": "^0.31.3",
|
|
35
|
-
"@ttoss/logger": "^0.6.4",
|
|
36
35
|
"@ttoss/react-i18n": "^2.0.14",
|
|
36
|
+
"@ttoss/logger": "^0.6.4",
|
|
37
|
+
"@ttoss/forms": "^0.31.3",
|
|
37
38
|
"@ttoss/react-notifications": "^2.4.3",
|
|
38
39
|
"@ttoss/ui": "^5.9.2"
|
|
39
40
|
},
|
|
@@ -44,13 +45,13 @@
|
|
|
44
45
|
"jest": "^30.0.4",
|
|
45
46
|
"react": "^19.1.0",
|
|
46
47
|
"tsup": "^8.5.0",
|
|
48
|
+
"@ttoss/cloud-auth": "^0.13.2",
|
|
47
49
|
"@ttoss/components": "^2.2.26",
|
|
48
|
-
"@ttoss/cloud-auth": "^0.13.1",
|
|
49
50
|
"@ttoss/config": "^1.35.6",
|
|
50
|
-
"@ttoss/i18n-cli": "^0.7.31",
|
|
51
|
-
"@ttoss/logger": "^0.6.4",
|
|
52
51
|
"@ttoss/forms": "^0.31.3",
|
|
52
|
+
"@ttoss/logger": "^0.6.4",
|
|
53
53
|
"@ttoss/react-i18n": "^2.0.14",
|
|
54
|
+
"@ttoss/i18n-cli": "^0.7.31",
|
|
54
55
|
"@ttoss/react-notifications": "^2.4.3",
|
|
55
56
|
"@ttoss/test-utils": "^2.1.26",
|
|
56
57
|
"@ttoss/ui": "^5.9.2"
|