@panneau/form-auth 3.0.120 → 3.0.127
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/lib/index.js +85 -95
- package/package.json +7 -6
package/lib/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
4
|
var core = require('@panneau/core');
|
|
7
5
|
var Form = require('@panneau/form');
|
|
@@ -11,19 +9,11 @@ var reactIntl = require('react-intl');
|
|
|
11
9
|
var Link = require('@panneau/element-link');
|
|
12
10
|
var fetch = require('@folklore/fetch');
|
|
13
11
|
|
|
14
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
-
|
|
16
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
17
|
-
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
|
18
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
19
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
-
var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
21
|
-
|
|
22
12
|
var _excluded$8 = ["action", "fields", "size", "currentPasswordLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
|
|
23
13
|
var propTypes$8 = {
|
|
24
|
-
action:
|
|
14
|
+
action: PropTypes.string,
|
|
25
15
|
fields: core.PropTypes.fields,
|
|
26
|
-
size:
|
|
16
|
+
size: PropTypes.string,
|
|
27
17
|
currentPasswordLabel: core.PropTypes.label,
|
|
28
18
|
passwordLabel: core.PropTypes.label,
|
|
29
19
|
passwordConfirmationLabel: core.PropTypes.label,
|
|
@@ -33,28 +23,28 @@ var defaultProps$8 = {
|
|
|
33
23
|
action: '/user/password',
|
|
34
24
|
fields: null,
|
|
35
25
|
size: 'lg',
|
|
36
|
-
currentPasswordLabel: /*#__PURE__*/
|
|
26
|
+
currentPasswordLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
37
27
|
id: "8LSb8C",
|
|
38
28
|
defaultMessage: [{
|
|
39
29
|
"type": 0,
|
|
40
30
|
"value": "Current password"
|
|
41
31
|
}]
|
|
42
32
|
}),
|
|
43
|
-
passwordLabel: /*#__PURE__*/
|
|
33
|
+
passwordLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
44
34
|
id: "XJ1dc3",
|
|
45
35
|
defaultMessage: [{
|
|
46
36
|
"type": 0,
|
|
47
37
|
"value": "New password"
|
|
48
38
|
}]
|
|
49
39
|
}),
|
|
50
|
-
passwordConfirmationLabel: /*#__PURE__*/
|
|
40
|
+
passwordConfirmationLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
51
41
|
id: "DUbv+u",
|
|
52
42
|
defaultMessage: [{
|
|
53
43
|
"type": 0,
|
|
54
44
|
"value": "Confirm your new password"
|
|
55
45
|
}]
|
|
56
46
|
}),
|
|
57
|
-
submitButtonLabel: /*#__PURE__*/
|
|
47
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
58
48
|
id: "XW9IKQ",
|
|
59
49
|
defaultMessage: [{
|
|
60
50
|
"type": 0,
|
|
@@ -70,8 +60,8 @@ var ChangePassword = function ChangePassword(_ref) {
|
|
|
70
60
|
passwordLabel = _ref.passwordLabel,
|
|
71
61
|
passwordConfirmationLabel = _ref.passwordConfirmationLabel,
|
|
72
62
|
submitButtonLabel = _ref.submitButtonLabel,
|
|
73
|
-
props =
|
|
74
|
-
return /*#__PURE__*/
|
|
63
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
64
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
75
65
|
action: action,
|
|
76
66
|
method: "PUT",
|
|
77
67
|
fields: fields || [{
|
|
@@ -99,9 +89,9 @@ var ChangePassword$1 = ChangePassword;
|
|
|
99
89
|
|
|
100
90
|
var _excluded$7 = ["action", "fields", "size", "passwordLabel", "submitButtonLabel"];
|
|
101
91
|
var propTypes$7 = {
|
|
102
|
-
action:
|
|
92
|
+
action: PropTypes.string,
|
|
103
93
|
fields: core.PropTypes.fields,
|
|
104
|
-
size:
|
|
94
|
+
size: PropTypes.string,
|
|
105
95
|
passwordLabel: core.PropTypes.label,
|
|
106
96
|
submitButtonLabel: core.PropTypes.label
|
|
107
97
|
};
|
|
@@ -109,14 +99,14 @@ var defaultProps$7 = {
|
|
|
109
99
|
action: '/user/confirm-password',
|
|
110
100
|
fields: null,
|
|
111
101
|
size: 'lg',
|
|
112
|
-
passwordLabel: /*#__PURE__*/
|
|
102
|
+
passwordLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
113
103
|
id: "B1h3gd",
|
|
114
104
|
defaultMessage: [{
|
|
115
105
|
"type": 0,
|
|
116
106
|
"value": "Please enter your password to continue"
|
|
117
107
|
}]
|
|
118
108
|
}),
|
|
119
|
-
submitButtonLabel: /*#__PURE__*/
|
|
109
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
120
110
|
id: "QUAHwy",
|
|
121
111
|
defaultMessage: [{
|
|
122
112
|
"type": 0,
|
|
@@ -130,8 +120,8 @@ var ConfirmPassword = function ConfirmPassword(_ref) {
|
|
|
130
120
|
size = _ref.size,
|
|
131
121
|
passwordLabel = _ref.passwordLabel,
|
|
132
122
|
submitButtonLabel = _ref.submitButtonLabel,
|
|
133
|
-
props =
|
|
134
|
-
return /*#__PURE__*/
|
|
123
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
124
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
135
125
|
action: action,
|
|
136
126
|
fields: fields || [{
|
|
137
127
|
name: 'password',
|
|
@@ -148,27 +138,27 @@ var ConfirmPassword$1 = ConfirmPassword;
|
|
|
148
138
|
|
|
149
139
|
var _excluded$6 = ["action", "fields", "emailLabel", "submitButtonLabel", "size", "withLoginLink", "loginLink", "loginLabel"];
|
|
150
140
|
var propTypes$6 = {
|
|
151
|
-
action:
|
|
141
|
+
action: PropTypes.string,
|
|
152
142
|
fields: core.PropTypes.fields,
|
|
153
|
-
size:
|
|
143
|
+
size: PropTypes.string,
|
|
154
144
|
emailLabel: core.PropTypes.label,
|
|
155
145
|
submitButtonLabel: core.PropTypes.label,
|
|
156
|
-
withLoginLink:
|
|
157
|
-
loginLink:
|
|
146
|
+
withLoginLink: PropTypes.bool,
|
|
147
|
+
loginLink: PropTypes.string,
|
|
158
148
|
loginLabel: core.PropTypes.label
|
|
159
149
|
};
|
|
160
150
|
var defaultProps$6 = {
|
|
161
151
|
action: '/forgot-password',
|
|
162
152
|
fields: null,
|
|
163
153
|
size: 'lg',
|
|
164
|
-
emailLabel: /*#__PURE__*/
|
|
154
|
+
emailLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
165
155
|
id: "LI0Gz4",
|
|
166
156
|
defaultMessage: [{
|
|
167
157
|
"type": 0,
|
|
168
158
|
"value": "Email"
|
|
169
159
|
}]
|
|
170
160
|
}),
|
|
171
|
-
submitButtonLabel: /*#__PURE__*/
|
|
161
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
172
162
|
id: "12Px0g",
|
|
173
163
|
defaultMessage: [{
|
|
174
164
|
"type": 0,
|
|
@@ -177,7 +167,7 @@ var defaultProps$6 = {
|
|
|
177
167
|
}),
|
|
178
168
|
withLoginLink: true,
|
|
179
169
|
loginLink: '/login',
|
|
180
|
-
loginLabel: /*#__PURE__*/
|
|
170
|
+
loginLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
181
171
|
id: "tPeIKO",
|
|
182
172
|
defaultMessage: [{
|
|
183
173
|
"type": 0,
|
|
@@ -194,8 +184,8 @@ var ForgotPassword = function ForgotPassword(_ref) {
|
|
|
194
184
|
withLoginLink = _ref.withLoginLink,
|
|
195
185
|
loginLink = _ref.loginLink,
|
|
196
186
|
loginLabel = _ref.loginLabel,
|
|
197
|
-
props =
|
|
198
|
-
return /*#__PURE__*/
|
|
187
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
188
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
199
189
|
action: action,
|
|
200
190
|
fields: fields || [{
|
|
201
191
|
name: 'email',
|
|
@@ -204,7 +194,7 @@ var ForgotPassword = function ForgotPassword(_ref) {
|
|
|
204
194
|
label: emailLabel
|
|
205
195
|
}],
|
|
206
196
|
submitButtonLabel: submitButtonLabel,
|
|
207
|
-
actions: withLoginLink ? /*#__PURE__*/
|
|
197
|
+
actions: withLoginLink ? /*#__PURE__*/React.createElement(Link, {
|
|
208
198
|
href: loginLink,
|
|
209
199
|
className: "py-2 px-4"
|
|
210
200
|
}, loginLabel) : null
|
|
@@ -216,15 +206,15 @@ var ForgotPassword$1 = ForgotPassword;
|
|
|
216
206
|
|
|
217
207
|
var _excluded$5 = ["action", "postForm", "fields", "size", "emailLabel", "passwordLabel", "submitButtonLabel", "withForgotPassword", "forgotPasswordLink", "forgotPasswordLabel"];
|
|
218
208
|
var propTypes$5 = {
|
|
219
|
-
action:
|
|
220
|
-
postForm:
|
|
209
|
+
action: PropTypes.string,
|
|
210
|
+
postForm: PropTypes.func,
|
|
221
211
|
fields: core.PropTypes.fields,
|
|
222
|
-
size:
|
|
212
|
+
size: PropTypes.string,
|
|
223
213
|
emailLabel: core.PropTypes.label,
|
|
224
214
|
passwordLabel: core.PropTypes.label,
|
|
225
215
|
submitButtonLabel: core.PropTypes.label,
|
|
226
|
-
withForgotPassword:
|
|
227
|
-
forgotPasswordLink:
|
|
216
|
+
withForgotPassword: PropTypes.bool,
|
|
217
|
+
forgotPasswordLink: PropTypes.string,
|
|
228
218
|
forgotPasswordLabel: core.PropTypes.label
|
|
229
219
|
};
|
|
230
220
|
var defaultProps$5 = {
|
|
@@ -232,21 +222,21 @@ var defaultProps$5 = {
|
|
|
232
222
|
postForm: null,
|
|
233
223
|
fields: null,
|
|
234
224
|
size: 'lg',
|
|
235
|
-
emailLabel: /*#__PURE__*/
|
|
225
|
+
emailLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
236
226
|
id: "LI0Gz4",
|
|
237
227
|
defaultMessage: [{
|
|
238
228
|
"type": 0,
|
|
239
229
|
"value": "Email"
|
|
240
230
|
}]
|
|
241
231
|
}),
|
|
242
|
-
passwordLabel: /*#__PURE__*/
|
|
232
|
+
passwordLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
243
233
|
id: "4yfet+",
|
|
244
234
|
defaultMessage: [{
|
|
245
235
|
"type": 0,
|
|
246
236
|
"value": "Password"
|
|
247
237
|
}]
|
|
248
238
|
}),
|
|
249
|
-
submitButtonLabel: /*#__PURE__*/
|
|
239
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
250
240
|
id: "g6qbbX",
|
|
251
241
|
defaultMessage: [{
|
|
252
242
|
"type": 0,
|
|
@@ -255,7 +245,7 @@ var defaultProps$5 = {
|
|
|
255
245
|
}),
|
|
256
246
|
withForgotPassword: false,
|
|
257
247
|
forgotPasswordLink: '/forgot-password',
|
|
258
|
-
forgotPasswordLabel: /*#__PURE__*/
|
|
248
|
+
forgotPasswordLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
259
249
|
id: "ZBNqY2",
|
|
260
250
|
defaultMessage: [{
|
|
261
251
|
"type": 0,
|
|
@@ -274,8 +264,8 @@ var Login = function Login(_ref) {
|
|
|
274
264
|
withForgotPassword = _ref.withForgotPassword,
|
|
275
265
|
forgotPasswordLink = _ref.forgotPasswordLink,
|
|
276
266
|
forgotPasswordLabel = _ref.forgotPasswordLabel,
|
|
277
|
-
props =
|
|
278
|
-
return /*#__PURE__*/
|
|
267
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
268
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
279
269
|
action: action,
|
|
280
270
|
postForm: postForm,
|
|
281
271
|
fields: fields || [{
|
|
@@ -290,7 +280,7 @@ var Login = function Login(_ref) {
|
|
|
290
280
|
label: passwordLabel
|
|
291
281
|
}],
|
|
292
282
|
submitButtonLabel: submitButtonLabel,
|
|
293
|
-
actions: withForgotPassword ? /*#__PURE__*/
|
|
283
|
+
actions: withForgotPassword ? /*#__PURE__*/React.createElement(Link, {
|
|
294
284
|
href: forgotPasswordLink,
|
|
295
285
|
className: "py-2 px-4"
|
|
296
286
|
}, forgotPasswordLabel) : null
|
|
@@ -302,51 +292,51 @@ var Login$1 = Login;
|
|
|
302
292
|
|
|
303
293
|
var _excluded$4 = ["action", "fields", "size", "nameLabel", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel", "withLoginLink", "loginLink", "loginLabel"];
|
|
304
294
|
var propTypes$4 = {
|
|
305
|
-
action:
|
|
295
|
+
action: PropTypes.string,
|
|
306
296
|
fields: core.PropTypes.fields,
|
|
307
|
-
size:
|
|
297
|
+
size: PropTypes.string,
|
|
308
298
|
nameLabel: core.PropTypes.label,
|
|
309
299
|
emailLabel: core.PropTypes.label,
|
|
310
300
|
passwordLabel: core.PropTypes.label,
|
|
311
301
|
passwordConfirmationLabel: core.PropTypes.label,
|
|
312
302
|
submitButtonLabel: core.PropTypes.label,
|
|
313
|
-
withLoginLink:
|
|
314
|
-
loginLink:
|
|
303
|
+
withLoginLink: PropTypes.bool,
|
|
304
|
+
loginLink: PropTypes.string,
|
|
315
305
|
loginLabel: core.PropTypes.label
|
|
316
306
|
};
|
|
317
307
|
var defaultProps$4 = {
|
|
318
308
|
action: '/register',
|
|
319
309
|
fields: null,
|
|
320
310
|
size: 'lg',
|
|
321
|
-
nameLabel: /*#__PURE__*/
|
|
311
|
+
nameLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
322
312
|
id: "UUv8FR",
|
|
323
313
|
defaultMessage: [{
|
|
324
314
|
"type": 0,
|
|
325
315
|
"value": "Name"
|
|
326
316
|
}]
|
|
327
317
|
}),
|
|
328
|
-
emailLabel: /*#__PURE__*/
|
|
318
|
+
emailLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
329
319
|
id: "LI0Gz4",
|
|
330
320
|
defaultMessage: [{
|
|
331
321
|
"type": 0,
|
|
332
322
|
"value": "Email"
|
|
333
323
|
}]
|
|
334
324
|
}),
|
|
335
|
-
passwordLabel: /*#__PURE__*/
|
|
325
|
+
passwordLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
336
326
|
id: "4yfet+",
|
|
337
327
|
defaultMessage: [{
|
|
338
328
|
"type": 0,
|
|
339
329
|
"value": "Password"
|
|
340
330
|
}]
|
|
341
331
|
}),
|
|
342
|
-
passwordConfirmationLabel: /*#__PURE__*/
|
|
332
|
+
passwordConfirmationLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
343
333
|
id: "VhJUeW",
|
|
344
334
|
defaultMessage: [{
|
|
345
335
|
"type": 0,
|
|
346
336
|
"value": "Confirm your password"
|
|
347
337
|
}]
|
|
348
338
|
}),
|
|
349
|
-
submitButtonLabel: /*#__PURE__*/
|
|
339
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
350
340
|
id: "PQX/ph",
|
|
351
341
|
defaultMessage: [{
|
|
352
342
|
"type": 0,
|
|
@@ -355,7 +345,7 @@ var defaultProps$4 = {
|
|
|
355
345
|
}),
|
|
356
346
|
withLoginLink: true,
|
|
357
347
|
loginLink: '/login',
|
|
358
|
-
loginLabel: /*#__PURE__*/
|
|
348
|
+
loginLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
359
349
|
id: "wa783M",
|
|
360
350
|
defaultMessage: [{
|
|
361
351
|
"type": 0,
|
|
@@ -375,8 +365,8 @@ var Register = function Register(_ref) {
|
|
|
375
365
|
withLoginLink = _ref.withLoginLink,
|
|
376
366
|
loginLink = _ref.loginLink,
|
|
377
367
|
loginLabel = _ref.loginLabel,
|
|
378
|
-
props =
|
|
379
|
-
return /*#__PURE__*/
|
|
368
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
369
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
380
370
|
action: action,
|
|
381
371
|
fields: fields || [{
|
|
382
372
|
name: 'name',
|
|
@@ -400,7 +390,7 @@ var Register = function Register(_ref) {
|
|
|
400
390
|
label: passwordConfirmationLabel
|
|
401
391
|
}],
|
|
402
392
|
submitButtonLabel: submitButtonLabel,
|
|
403
|
-
actions: withLoginLink ? /*#__PURE__*/
|
|
393
|
+
actions: withLoginLink ? /*#__PURE__*/React.createElement(Link, {
|
|
404
394
|
href: loginLink,
|
|
405
395
|
className: "py-2 px-4"
|
|
406
396
|
}, loginLabel) : null
|
|
@@ -412,9 +402,9 @@ var Register$1 = Register;
|
|
|
412
402
|
|
|
413
403
|
var _excluded$3 = ["action", "fields", "size", "emailLabel", "passwordLabel", "passwordConfirmationLabel", "submitButtonLabel"];
|
|
414
404
|
var propTypes$3 = {
|
|
415
|
-
action:
|
|
405
|
+
action: PropTypes.string,
|
|
416
406
|
fields: core.PropTypes.fields,
|
|
417
|
-
size:
|
|
407
|
+
size: PropTypes.string,
|
|
418
408
|
emailLabel: core.PropTypes.label,
|
|
419
409
|
passwordLabel: core.PropTypes.label,
|
|
420
410
|
passwordConfirmationLabel: core.PropTypes.label,
|
|
@@ -424,28 +414,28 @@ var defaultProps$3 = {
|
|
|
424
414
|
action: '/reset-password',
|
|
425
415
|
fields: null,
|
|
426
416
|
size: 'lg',
|
|
427
|
-
emailLabel: /*#__PURE__*/
|
|
417
|
+
emailLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
428
418
|
id: "LI0Gz4",
|
|
429
419
|
defaultMessage: [{
|
|
430
420
|
"type": 0,
|
|
431
421
|
"value": "Email"
|
|
432
422
|
}]
|
|
433
423
|
}),
|
|
434
|
-
passwordLabel: /*#__PURE__*/
|
|
424
|
+
passwordLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
435
425
|
id: "4yfet+",
|
|
436
426
|
defaultMessage: [{
|
|
437
427
|
"type": 0,
|
|
438
428
|
"value": "Password"
|
|
439
429
|
}]
|
|
440
430
|
}),
|
|
441
|
-
passwordConfirmationLabel: /*#__PURE__*/
|
|
431
|
+
passwordConfirmationLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
442
432
|
id: "VhJUeW",
|
|
443
433
|
defaultMessage: [{
|
|
444
434
|
"type": 0,
|
|
445
435
|
"value": "Confirm your password"
|
|
446
436
|
}]
|
|
447
437
|
}),
|
|
448
|
-
submitButtonLabel: /*#__PURE__*/
|
|
438
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
449
439
|
id: "zwks3g",
|
|
450
440
|
defaultMessage: [{
|
|
451
441
|
"type": 0,
|
|
@@ -461,8 +451,8 @@ var ResetPassword = function ResetPassword(_ref) {
|
|
|
461
451
|
passwordLabel = _ref.passwordLabel,
|
|
462
452
|
passwordConfirmationLabel = _ref.passwordConfirmationLabel,
|
|
463
453
|
submitButtonLabel = _ref.submitButtonLabel,
|
|
464
|
-
props =
|
|
465
|
-
return /*#__PURE__*/
|
|
454
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
455
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
466
456
|
action: action,
|
|
467
457
|
fields: fields || [{
|
|
468
458
|
name: 'email',
|
|
@@ -490,9 +480,9 @@ var ResetPassword$1 = ResetPassword;
|
|
|
490
480
|
|
|
491
481
|
var _excluded$2 = ["action", "fields", "size", "codeLabel", "submitButtonLabel"];
|
|
492
482
|
var propTypes$2 = {
|
|
493
|
-
action:
|
|
483
|
+
action: PropTypes.string,
|
|
494
484
|
fields: core.PropTypes.fields,
|
|
495
|
-
size:
|
|
485
|
+
size: PropTypes.string,
|
|
496
486
|
codeLabel: core.PropTypes.label,
|
|
497
487
|
submitButtonLabel: core.PropTypes.label
|
|
498
488
|
};
|
|
@@ -500,14 +490,14 @@ var defaultProps$2 = {
|
|
|
500
490
|
action: '/two-factor-challenge',
|
|
501
491
|
fields: null,
|
|
502
492
|
size: 'lg',
|
|
503
|
-
codeLabel: /*#__PURE__*/
|
|
493
|
+
codeLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
504
494
|
id: "22Ld5M",
|
|
505
495
|
defaultMessage: [{
|
|
506
496
|
"type": 0,
|
|
507
497
|
"value": "Enter the code from your authenticator app to continue"
|
|
508
498
|
}]
|
|
509
499
|
}),
|
|
510
|
-
submitButtonLabel: /*#__PURE__*/
|
|
500
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
511
501
|
id: "QUAHwy",
|
|
512
502
|
defaultMessage: [{
|
|
513
503
|
"type": 0,
|
|
@@ -521,8 +511,8 @@ var TwoFactorChallenge = function TwoFactorChallenge(_ref) {
|
|
|
521
511
|
size = _ref.size,
|
|
522
512
|
codeLabel = _ref.codeLabel,
|
|
523
513
|
submitButtonLabel = _ref.submitButtonLabel,
|
|
524
|
-
props =
|
|
525
|
-
return /*#__PURE__*/
|
|
514
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
515
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
526
516
|
action: action,
|
|
527
517
|
fields: fields || [{
|
|
528
518
|
name: 'code',
|
|
@@ -539,27 +529,27 @@ var TwoFactorChallenge$1 = TwoFactorChallenge;
|
|
|
539
529
|
|
|
540
530
|
var _excluded$1 = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withCancelLink", "cancelLink", "cancelLabel"];
|
|
541
531
|
var propTypes$1 = {
|
|
542
|
-
action:
|
|
532
|
+
action: PropTypes.string,
|
|
543
533
|
fields: core.PropTypes.fields,
|
|
544
|
-
size:
|
|
534
|
+
size: PropTypes.string,
|
|
545
535
|
explainationLabel: core.PropTypes.label,
|
|
546
536
|
submitButtonLabel: core.PropTypes.label,
|
|
547
|
-
withCancelLink:
|
|
548
|
-
cancelLink:
|
|
537
|
+
withCancelLink: PropTypes.bool,
|
|
538
|
+
cancelLink: PropTypes.string,
|
|
549
539
|
cancelLabel: core.PropTypes.label
|
|
550
540
|
};
|
|
551
541
|
var defaultProps$1 = {
|
|
552
542
|
action: '/user/two-factor-authentication',
|
|
553
543
|
fields: null,
|
|
554
544
|
size: 'lg',
|
|
555
|
-
explainationLabel: /*#__PURE__*/
|
|
545
|
+
explainationLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
556
546
|
id: "5nHK/H",
|
|
557
547
|
defaultMessage: [{
|
|
558
548
|
"type": 0,
|
|
559
549
|
"value": "Do you really wish to disable two factor authentication on your account?"
|
|
560
550
|
}]
|
|
561
551
|
}),
|
|
562
|
-
submitButtonLabel: /*#__PURE__*/
|
|
552
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
563
553
|
id: "gWmL5V",
|
|
564
554
|
defaultMessage: [{
|
|
565
555
|
"type": 0,
|
|
@@ -568,7 +558,7 @@ var defaultProps$1 = {
|
|
|
568
558
|
}),
|
|
569
559
|
withCancelLink: true,
|
|
570
560
|
cancelLink: '/home',
|
|
571
|
-
cancelLabel: /*#__PURE__*/
|
|
561
|
+
cancelLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
572
562
|
id: "U/ye2x",
|
|
573
563
|
defaultMessage: [{
|
|
574
564
|
"type": 0,
|
|
@@ -585,7 +575,7 @@ var TwoFactorDisable = function TwoFactorDisable(_ref) {
|
|
|
585
575
|
var withCancelLink = _ref.withCancelLink,
|
|
586
576
|
cancelLink = _ref.cancelLink,
|
|
587
577
|
cancelLabel = _ref.cancelLabel,
|
|
588
|
-
props =
|
|
578
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
589
579
|
var defaultPostForm = React.useCallback(function (act, data) {
|
|
590
580
|
return fetch.postJSON(act, data, {
|
|
591
581
|
credentials: 'include',
|
|
@@ -593,15 +583,15 @@ var TwoFactorDisable = function TwoFactorDisable(_ref) {
|
|
|
593
583
|
method: 'DELETE'
|
|
594
584
|
});
|
|
595
585
|
}, []);
|
|
596
|
-
return /*#__PURE__*/
|
|
586
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
597
587
|
action: action,
|
|
598
588
|
submitButtonLabel: submitButtonLabel,
|
|
599
|
-
actions: withCancelLink ? /*#__PURE__*/
|
|
589
|
+
actions: withCancelLink ? /*#__PURE__*/React.createElement(Link, {
|
|
600
590
|
className: "py-2 px-4",
|
|
601
591
|
href: cancelLink
|
|
602
592
|
}, cancelLabel) : null,
|
|
603
593
|
postForm: defaultPostForm
|
|
604
|
-
}, props), /*#__PURE__*/
|
|
594
|
+
}, props), /*#__PURE__*/React.createElement("p", null, explainationLabel));
|
|
605
595
|
};
|
|
606
596
|
TwoFactorDisable.propTypes = propTypes$1;
|
|
607
597
|
TwoFactorDisable.defaultProps = defaultProps$1;
|
|
@@ -609,27 +599,27 @@ var TwoFactorDisable$1 = TwoFactorDisable;
|
|
|
609
599
|
|
|
610
600
|
var _excluded = ["action", "fields", "explainationLabel", "submitButtonLabel", "size", "withSkipLink", "skipLink", "skipLabel"];
|
|
611
601
|
var propTypes = {
|
|
612
|
-
action:
|
|
602
|
+
action: PropTypes.string,
|
|
613
603
|
fields: core.PropTypes.fields,
|
|
614
|
-
size:
|
|
604
|
+
size: PropTypes.string,
|
|
615
605
|
explainationLabel: core.PropTypes.label,
|
|
616
606
|
submitButtonLabel: core.PropTypes.label,
|
|
617
|
-
withSkipLink:
|
|
618
|
-
skipLink:
|
|
607
|
+
withSkipLink: PropTypes.bool,
|
|
608
|
+
skipLink: PropTypes.string,
|
|
619
609
|
skipLabel: core.PropTypes.label
|
|
620
610
|
};
|
|
621
611
|
var defaultProps = {
|
|
622
612
|
action: '/user/two-factor-authentication',
|
|
623
613
|
fields: null,
|
|
624
614
|
size: 'lg',
|
|
625
|
-
explainationLabel: /*#__PURE__*/
|
|
615
|
+
explainationLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
626
616
|
id: "zTiC4D",
|
|
627
617
|
defaultMessage: [{
|
|
628
618
|
"type": 0,
|
|
629
619
|
"value": "Do you wish to enable two factor authentication on your account? You will have to use an authentication app such as Google Authenticator or Microsoft Authenticator in addition to your password to connect."
|
|
630
620
|
}]
|
|
631
621
|
}),
|
|
632
|
-
submitButtonLabel: /*#__PURE__*/
|
|
622
|
+
submitButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
633
623
|
id: "pVHYDd",
|
|
634
624
|
defaultMessage: [{
|
|
635
625
|
"type": 0,
|
|
@@ -638,7 +628,7 @@ var defaultProps = {
|
|
|
638
628
|
}),
|
|
639
629
|
withSkipLink: true,
|
|
640
630
|
skipLink: '/home',
|
|
641
|
-
skipLabel: /*#__PURE__*/
|
|
631
|
+
skipLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
642
632
|
id: "li2Qqu",
|
|
643
633
|
defaultMessage: [{
|
|
644
634
|
"type": 0,
|
|
@@ -655,15 +645,15 @@ var TwoFactorEnable = function TwoFactorEnable(_ref) {
|
|
|
655
645
|
var withSkipLink = _ref.withSkipLink,
|
|
656
646
|
skipLink = _ref.skipLink,
|
|
657
647
|
skipLabel = _ref.skipLabel,
|
|
658
|
-
props =
|
|
659
|
-
return /*#__PURE__*/
|
|
648
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
649
|
+
return /*#__PURE__*/React.createElement(Form, Object.assign({
|
|
660
650
|
action: action,
|
|
661
651
|
submitButtonLabel: submitButtonLabel,
|
|
662
|
-
actions: withSkipLink ? /*#__PURE__*/
|
|
652
|
+
actions: withSkipLink ? /*#__PURE__*/React.createElement(Link, {
|
|
663
653
|
className: "py-2 px-4",
|
|
664
654
|
href: skipLink
|
|
665
655
|
}, skipLabel) : null
|
|
666
|
-
}, props), /*#__PURE__*/
|
|
656
|
+
}, props), /*#__PURE__*/React.createElement("p", null, explainationLabel));
|
|
667
657
|
};
|
|
668
658
|
TwoFactorEnable.propTypes = propTypes;
|
|
669
659
|
TwoFactorEnable.defaultProps = defaultProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/form-auth",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.127",
|
|
4
4
|
"description": "Basic forgot password form",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"assets"
|
|
34
34
|
],
|
|
35
35
|
"scripts": {
|
|
36
|
-
"
|
|
36
|
+
"prepublishOnly": "npm run build",
|
|
37
|
+
"build": "../../scripts/prepare-package.sh"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -46,9 +47,9 @@
|
|
|
46
47
|
"dependencies": {
|
|
47
48
|
"@babel/runtime": "^7.12.5",
|
|
48
49
|
"@folklore/fetch": "^0.1.16",
|
|
49
|
-
"@panneau/core": "^3.0.
|
|
50
|
-
"@panneau/element-link": "^3.0.
|
|
51
|
-
"@panneau/form": "^3.0.
|
|
50
|
+
"@panneau/core": "^3.0.126",
|
|
51
|
+
"@panneau/element-link": "^3.0.126",
|
|
52
|
+
"@panneau/form": "^3.0.127",
|
|
52
53
|
"classnames": "^2.2.6",
|
|
53
54
|
"lodash": "^4.17.21",
|
|
54
55
|
"prop-types": "^15.7.2",
|
|
@@ -57,5 +58,5 @@
|
|
|
57
58
|
"publishConfig": {
|
|
58
59
|
"access": "public"
|
|
59
60
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "7bf824aaa232f4d9ba161f406213b9384cabf8ba"
|
|
61
62
|
}
|