@ttoss/react-auth 2.6.40 → 2.6.42
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 +19 -17
- package/i18n/compiled/en.json +18 -0
- package/i18n/lang/en.json +12 -0
- package/package.json +12 -12
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
4
|
+
value,
|
|
5
|
+
configurable: true
|
|
6
|
+
});
|
|
2
7
|
|
|
3
8
|
// src/Auth.tsx
|
|
4
9
|
import { Auth as AuthCore, useAuthScreen } from "@ttoss/react-auth-core";
|
|
@@ -6,8 +11,7 @@ import { useI18n } from "@ttoss/react-i18n";
|
|
|
6
11
|
import { useNotifications } from "@ttoss/react-notifications";
|
|
7
12
|
import { confirmResetPassword, confirmSignUp, resendSignUpCode, resetPassword, signIn, signUp } from "aws-amplify/auth";
|
|
8
13
|
import * as React from "react";
|
|
9
|
-
|
|
10
|
-
var Auth = props => {
|
|
14
|
+
var Auth = /* @__PURE__ */__name(props => {
|
|
11
15
|
const {
|
|
12
16
|
intl
|
|
13
17
|
} = useI18n();
|
|
@@ -149,7 +153,7 @@ var Auth = props => {
|
|
|
149
153
|
});
|
|
150
154
|
}
|
|
151
155
|
}, [setScreen, addNotification]);
|
|
152
|
-
return /* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */React.createElement(AuthCore, {
|
|
153
157
|
screen,
|
|
154
158
|
setScreen,
|
|
155
159
|
onSignIn,
|
|
@@ -161,7 +165,7 @@ var Auth = props => {
|
|
|
161
165
|
logo: props.logo,
|
|
162
166
|
layout: props.layout
|
|
163
167
|
});
|
|
164
|
-
};
|
|
168
|
+
}, "Auth");
|
|
165
169
|
|
|
166
170
|
// src/AuthProvider.tsx
|
|
167
171
|
import { AuthProvider as AuthProviderCore, useAuth } from "@ttoss/react-auth-core";
|
|
@@ -171,7 +175,7 @@ import * as React2 from "react";
|
|
|
171
175
|
|
|
172
176
|
// src/getAuthData.ts
|
|
173
177
|
import { fetchAuthSession, fetchUserAttributes, getCurrentUser } from "aws-amplify/auth";
|
|
174
|
-
var getAuthData = async ({
|
|
178
|
+
var getAuthData = /* @__PURE__ */__name(async ({
|
|
175
179
|
includeTokens
|
|
176
180
|
} = {}) => {
|
|
177
181
|
const currentUser = await getCurrentUser();
|
|
@@ -192,26 +196,25 @@ var getAuthData = async ({
|
|
|
192
196
|
},
|
|
193
197
|
isAuthenticated: true
|
|
194
198
|
};
|
|
195
|
-
};
|
|
196
|
-
var checkAuth = async () => {
|
|
199
|
+
}, "getAuthData");
|
|
200
|
+
var checkAuth = /* @__PURE__ */__name(async () => {
|
|
197
201
|
try {
|
|
198
202
|
const currentUser = await getCurrentUser();
|
|
199
203
|
return !!currentUser;
|
|
200
204
|
} catch {
|
|
201
205
|
return false;
|
|
202
206
|
}
|
|
203
|
-
};
|
|
207
|
+
}, "checkAuth");
|
|
204
208
|
|
|
205
209
|
// src/AuthProvider.tsx
|
|
206
|
-
|
|
207
|
-
var AuthProvider = props => {
|
|
210
|
+
var AuthProvider = /* @__PURE__ */__name(props => {
|
|
208
211
|
const [authListenerCount, setAuthListenerCount] = React2.useState(0);
|
|
209
212
|
React2.useEffect(() => {
|
|
210
|
-
const listener = () => {
|
|
213
|
+
const listener = /* @__PURE__ */__name(() => {
|
|
211
214
|
setAuthListenerCount(count => {
|
|
212
215
|
return count + 1;
|
|
213
216
|
});
|
|
214
|
-
};
|
|
217
|
+
}, "listener");
|
|
215
218
|
const stopHubListener = Hub.listen("auth", listener);
|
|
216
219
|
return () => {
|
|
217
220
|
stopHubListener();
|
|
@@ -224,10 +227,9 @@ var AuthProvider = props => {
|
|
|
224
227
|
return null;
|
|
225
228
|
}
|
|
226
229
|
}, [authListenerCount]);
|
|
227
|
-
return /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */React2.createElement(AuthProviderCore, {
|
|
228
231
|
getAuthData: getAuthDataCallback,
|
|
229
|
-
signOut
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
};
|
|
232
|
+
signOut
|
|
233
|
+
}, props.children);
|
|
234
|
+
}, "AuthProvider");
|
|
233
235
|
export { Auth, AuthProvider, checkAuth, getAuthData, useAuth };
|
package/i18n/compiled/en.json
CHANGED
|
@@ -79,6 +79,12 @@
|
|
|
79
79
|
"value": "Reset Password"
|
|
80
80
|
}
|
|
81
81
|
],
|
|
82
|
+
"JEsxDw": [
|
|
83
|
+
{
|
|
84
|
+
"type": 0,
|
|
85
|
+
"value": "Uploading..."
|
|
86
|
+
}
|
|
87
|
+
],
|
|
82
88
|
"KY2T6J": [
|
|
83
89
|
{
|
|
84
90
|
"type": 0,
|
|
@@ -215,6 +221,18 @@
|
|
|
215
221
|
"value": "New Password"
|
|
216
222
|
}
|
|
217
223
|
],
|
|
224
|
+
"fDCMA6": [
|
|
225
|
+
{
|
|
226
|
+
"type": 0,
|
|
227
|
+
"value": "Select Files"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"gy0Ynb": [
|
|
231
|
+
{
|
|
232
|
+
"type": 0,
|
|
233
|
+
"value": "Click or drag files here"
|
|
234
|
+
}
|
|
235
|
+
],
|
|
218
236
|
"kdFYba": [
|
|
219
237
|
{
|
|
220
238
|
"type": 0,
|
package/i18n/lang/en.json
CHANGED
|
@@ -176,6 +176,18 @@
|
|
|
176
176
|
"defaultMessage": "Confirmation code",
|
|
177
177
|
"description": "Confirmation code"
|
|
178
178
|
},
|
|
179
|
+
"JEsxDw": {
|
|
180
|
+
"module": "@ttoss/components",
|
|
181
|
+
"defaultMessage": "Uploading..."
|
|
182
|
+
},
|
|
183
|
+
"fDCMA6": {
|
|
184
|
+
"module": "@ttoss/components",
|
|
185
|
+
"defaultMessage": "Select Files"
|
|
186
|
+
},
|
|
187
|
+
"gy0Ynb": {
|
|
188
|
+
"module": "@ttoss/components",
|
|
189
|
+
"defaultMessage": "Click or drag files here"
|
|
190
|
+
},
|
|
179
191
|
"D1C6fR": {
|
|
180
192
|
"module": "@ttoss/forms",
|
|
181
193
|
"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.42",
|
|
4
4
|
"description": "ttoss authentication module for React apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"react-error-boundary": "^5.0.0",
|
|
29
|
-
"@ttoss/react-auth-core": "^0.2.
|
|
29
|
+
"@ttoss/react-auth-core": "^0.2.12"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"aws-amplify": "^6.0.0",
|
|
33
33
|
"react": ">=16.8.0",
|
|
34
|
+
"@ttoss/components": "^2.4.2",
|
|
35
|
+
"@ttoss/forms": "^0.31.7",
|
|
36
|
+
"@ttoss/react-i18n": "^2.0.16",
|
|
37
|
+
"@ttoss/react-notifications": "^2.4.13",
|
|
34
38
|
"@ttoss/logger": "^0.6.4",
|
|
35
|
-
"@ttoss/components": "^2.4.0",
|
|
36
|
-
"@ttoss/react-notifications": "^2.4.11",
|
|
37
|
-
"@ttoss/forms": "^0.31.5",
|
|
38
|
-
"@ttoss/react-i18n": "^2.0.14",
|
|
39
39
|
"@ttoss/ui": "^5.10.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"react": "^19.1.0",
|
|
47
47
|
"tsup": "^8.5.0",
|
|
48
48
|
"@ttoss/cloud-auth": "^0.13.2",
|
|
49
|
-
"@ttoss/
|
|
50
|
-
"@ttoss/
|
|
51
|
-
"@ttoss/
|
|
52
|
-
"@ttoss/i18n-cli": "^0.7.31",
|
|
49
|
+
"@ttoss/components": "^2.4.2",
|
|
50
|
+
"@ttoss/forms": "^0.31.7",
|
|
51
|
+
"@ttoss/i18n-cli": "^0.7.32",
|
|
53
52
|
"@ttoss/logger": "^0.6.4",
|
|
54
|
-
"@ttoss/react-i18n": "^2.0.
|
|
55
|
-
"@ttoss/
|
|
53
|
+
"@ttoss/react-i18n": "^2.0.16",
|
|
54
|
+
"@ttoss/config": "^1.35.6",
|
|
55
|
+
"@ttoss/react-notifications": "^2.4.13",
|
|
56
56
|
"@ttoss/test-utils": "^2.1.26",
|
|
57
57
|
"@ttoss/ui": "^5.10.0"
|
|
58
58
|
},
|