keycloakify 7.14.1 → 7.14.3
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/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +213 -210
- package/login/lib/useFormValidation.js +2 -7
- package/login/lib/useFormValidation.js.map +1 -1
- package/package.json +1 -1
- package/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +213 -210
- package/src/login/lib/useFormValidation.tsx +2 -11
@@ -26,64 +26,77 @@
|
|
26
26
|
|
27
27
|
<#if !messagesPerField?? || !(messagesPerField?is_hash)>
|
28
28
|
throw new Error("You're not supposed to use messagesPerField.printIfExists in this page");
|
29
|
-
|
29
|
+
<#else>
|
30
|
+
<#list fieldNames as fieldName>
|
31
|
+
if(fieldName === "${fieldName}" ){
|
32
|
+
|
33
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
34
|
+
<#if !messagesPerField.existsError??>
|
30
35
|
|
31
|
-
|
32
|
-
|
36
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
37
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
33
38
|
|
34
|
-
|
35
|
-
|
39
|
+
<#assign doExistMessageForUsernameOrPassword = "">
|
40
|
+
|
41
|
+
<#attempt>
|
42
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
43
|
+
<#recover>
|
44
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
45
|
+
</#attempt>
|
36
46
|
|
37
|
-
|
38
|
-
|
47
|
+
<#if !doExistMessageForUsernameOrPassword>
|
48
|
+
<#attempt>
|
49
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('password')>
|
50
|
+
<#recover>
|
51
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
52
|
+
</#attempt>
|
53
|
+
</#if>
|
39
54
|
|
40
|
-
|
55
|
+
return <#if doExistMessageForUsernameOrPassword>text<#else>undefined</#if>;
|
41
56
|
|
42
|
-
<#
|
43
|
-
|
44
|
-
|
45
|
-
<#assign doExistMessageForUsernameOrPassword = true>
|
46
|
-
</#attempt>
|
57
|
+
<#else>
|
58
|
+
|
59
|
+
<#assign doExistMessageForField = "">
|
47
60
|
|
48
|
-
<#if !doExistMessageForUsernameOrPassword>
|
49
61
|
<#attempt>
|
50
|
-
<#assign
|
62
|
+
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
51
63
|
<#recover>
|
52
|
-
<#assign
|
64
|
+
<#assign doExistMessageForField = true>
|
53
65
|
</#attempt>
|
54
|
-
</#if>
|
55
66
|
|
56
|
-
|
67
|
+
return <#if doExistMessageForField>text<#else>undefined</#if>;
|
68
|
+
|
69
|
+
</#if>
|
57
70
|
|
58
71
|
<#else>
|
59
72
|
|
60
|
-
|
73
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
74
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
61
75
|
|
62
|
-
|
63
|
-
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
64
|
-
<#recover>
|
65
|
-
<#assign doExistMessageForField = true>
|
66
|
-
</#attempt>
|
76
|
+
<#assign doExistErrorOnUsernameOrPassword = "">
|
67
77
|
|
68
|
-
|
78
|
+
<#attempt>
|
79
|
+
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
80
|
+
<#recover>
|
81
|
+
<#assign doExistErrorOnUsernameOrPassword = true>
|
82
|
+
</#attempt>
|
69
83
|
|
70
|
-
|
84
|
+
<#if doExistErrorOnUsernameOrPassword>
|
85
|
+
return text;
|
86
|
+
<#else>
|
71
87
|
|
72
|
-
|
88
|
+
<#assign doExistMessageForField = "">
|
73
89
|
|
74
|
-
|
75
|
-
|
90
|
+
<#attempt>
|
91
|
+
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
92
|
+
<#recover>
|
93
|
+
<#assign doExistMessageForField = true>
|
94
|
+
</#attempt>
|
76
95
|
|
77
|
-
|
96
|
+
return <#if doExistMessageForField>text<#else>undefined</#if>;
|
78
97
|
|
79
|
-
|
80
|
-
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
81
|
-
<#recover>
|
82
|
-
<#assign doExistErrorOnUsernameOrPassword = true>
|
83
|
-
</#attempt>
|
98
|
+
</#if>
|
84
99
|
|
85
|
-
<#if doExistErrorOnUsernameOrPassword>
|
86
|
-
return text;
|
87
100
|
<#else>
|
88
101
|
|
89
102
|
<#assign doExistMessageForField = "">
|
@@ -98,109 +111,98 @@
|
|
98
111
|
|
99
112
|
</#if>
|
100
113
|
|
101
|
-
<#else>
|
102
|
-
|
103
|
-
<#assign doExistMessageForField = "">
|
104
|
-
|
105
|
-
<#attempt>
|
106
|
-
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
107
|
-
<#recover>
|
108
|
-
<#assign doExistMessageForField = true>
|
109
|
-
</#attempt>
|
110
|
-
|
111
|
-
return <#if doExistMessageForField>text<#else>undefined</#if>;
|
112
|
-
|
113
114
|
</#if>
|
114
115
|
|
115
|
-
|
116
|
+
}
|
117
|
+
</#list>
|
116
118
|
|
117
|
-
|
118
|
-
</#
|
119
|
+
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
120
|
+
</#if>
|
119
121
|
|
120
|
-
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
121
122
|
},
|
122
123
|
"existsError": function (fieldName) {
|
123
124
|
|
124
125
|
<#if !messagesPerField?? || !(messagesPerField?is_hash)>
|
125
126
|
throw new Error("You're not supposed to use messagesPerField.printIfExists in this page");
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
if(fieldName === "${fieldName}" ){
|
130
|
-
|
131
|
-
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
132
|
-
<#if !messagesPerField.existsError??>
|
127
|
+
<#else>
|
128
|
+
<#list fieldNames as fieldName>
|
129
|
+
if(fieldName === "${fieldName}" ){
|
133
130
|
|
134
|
-
<#-- https://github.com/keycloakify/keycloakify/pull/
|
135
|
-
<#if
|
131
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
132
|
+
<#if !messagesPerField.existsError??>
|
136
133
|
|
137
|
-
|
134
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
135
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
138
136
|
|
139
|
-
|
140
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
141
|
-
<#recover>
|
142
|
-
<#assign doExistMessageForUsernameOrPassword = true>
|
143
|
-
</#attempt>
|
137
|
+
<#assign doExistMessageForUsernameOrPassword = "">
|
144
138
|
|
145
|
-
<#if !doExistMessageForUsernameOrPassword>
|
146
139
|
<#attempt>
|
147
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('
|
140
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
148
141
|
<#recover>
|
149
142
|
<#assign doExistMessageForUsernameOrPassword = true>
|
150
143
|
</#attempt>
|
151
|
-
</#if>
|
152
144
|
|
153
|
-
|
145
|
+
<#if !doExistMessageForUsernameOrPassword>
|
146
|
+
<#attempt>
|
147
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('password')>
|
148
|
+
<#recover>
|
149
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
150
|
+
</#attempt>
|
151
|
+
</#if>
|
154
152
|
|
155
|
-
|
153
|
+
return <#if doExistMessageForUsernameOrPassword>true<#else>false</#if>;
|
156
154
|
|
157
|
-
<#
|
155
|
+
<#else>
|
158
156
|
|
159
|
-
|
160
|
-
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
161
|
-
<#recover>
|
162
|
-
<#assign doExistMessageForField = true>
|
163
|
-
</#attempt>
|
157
|
+
<#assign doExistMessageForField = "">
|
164
158
|
|
165
|
-
|
159
|
+
<#attempt>
|
160
|
+
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
161
|
+
<#recover>
|
162
|
+
<#assign doExistMessageForField = true>
|
163
|
+
</#attempt>
|
166
164
|
|
167
|
-
|
165
|
+
return <#if doExistMessageForField>true<#else>false</#if>;
|
168
166
|
|
169
|
-
|
167
|
+
</#if>
|
170
168
|
|
171
|
-
|
172
|
-
<#if '${fieldName}' == 'username' || '${fieldName}' == 'password'>
|
169
|
+
<#else>
|
173
170
|
|
174
|
-
|
171
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
172
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
175
173
|
|
176
|
-
|
177
|
-
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
178
|
-
<#recover>
|
179
|
-
<#assign doExistErrorOnUsernameOrPassword = true>
|
180
|
-
</#attempt>
|
174
|
+
<#assign doExistErrorOnUsernameOrPassword = "">
|
181
175
|
|
182
|
-
|
176
|
+
<#attempt>
|
177
|
+
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
178
|
+
<#recover>
|
179
|
+
<#assign doExistErrorOnUsernameOrPassword = true>
|
180
|
+
</#attempt>
|
183
181
|
|
184
|
-
|
182
|
+
return <#if doExistErrorOnUsernameOrPassword>true<#else>false</#if>;
|
183
|
+
|
184
|
+
<#else>
|
185
185
|
|
186
|
-
|
186
|
+
<#assign doExistErrorMessageForField = "">
|
187
187
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
188
|
+
<#attempt>
|
189
|
+
<#assign doExistErrorMessageForField = messagesPerField.existsError('${fieldName}')>
|
190
|
+
<#recover>
|
191
|
+
<#assign doExistErrorMessageForField = true>
|
192
|
+
</#attempt>
|
193
193
|
|
194
|
-
|
194
|
+
return <#if doExistErrorMessageForField>true<#else>false</#if>;
|
195
|
+
|
196
|
+
</#if>
|
195
197
|
|
196
198
|
</#if>
|
197
199
|
|
198
|
-
|
200
|
+
}
|
201
|
+
</#list>
|
199
202
|
|
200
|
-
|
201
|
-
</#list>
|
203
|
+
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
202
204
|
|
203
|
-
|
205
|
+
</#if>
|
204
206
|
|
205
207
|
},
|
206
208
|
"get": function (fieldName) {
|
@@ -208,184 +210,185 @@
|
|
208
210
|
|
209
211
|
<#if !messagesPerField?? || !(messagesPerField?is_hash)>
|
210
212
|
throw new Error("You're not supposed to use messagesPerField.get in this page");
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
if(fieldName === "${fieldName}" ){
|
213
|
+
<#else>
|
214
|
+
<#list fieldNames as fieldName>
|
215
|
+
if(fieldName === "${fieldName}" ){
|
215
216
|
|
216
|
-
|
217
|
-
|
217
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
218
|
+
<#if !messagesPerField.existsError??>
|
218
219
|
|
219
|
-
|
220
|
-
|
220
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
221
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
221
222
|
|
222
|
-
|
223
|
+
<#assign doExistMessageForUsernameOrPassword = "">
|
223
224
|
|
224
|
-
<#attempt>
|
225
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
226
|
-
<#recover>
|
227
|
-
<#assign doExistMessageForUsernameOrPassword = true>
|
228
|
-
</#attempt>
|
229
|
-
|
230
|
-
<#if !doExistMessageForUsernameOrPassword>
|
231
225
|
<#attempt>
|
232
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('
|
226
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
233
227
|
<#recover>
|
234
228
|
<#assign doExistMessageForUsernameOrPassword = true>
|
235
229
|
</#attempt>
|
236
|
-
</#if>
|
237
230
|
|
238
|
-
|
239
|
-
|
231
|
+
<#if !doExistMessageForUsernameOrPassword>
|
232
|
+
<#attempt>
|
233
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('password')>
|
234
|
+
<#recover>
|
235
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
236
|
+
</#attempt>
|
237
|
+
</#if>
|
238
|
+
|
239
|
+
<#if !doExistMessageForUsernameOrPassword>
|
240
|
+
return "";
|
241
|
+
<#else>
|
242
|
+
<#attempt>
|
243
|
+
return "${kcSanitize(msg('invalidUserMessage'))?no_esc}";
|
244
|
+
<#recover>
|
245
|
+
return "Invalid username or password.";
|
246
|
+
</#attempt>
|
247
|
+
</#if>
|
248
|
+
|
240
249
|
<#else>
|
250
|
+
|
241
251
|
<#attempt>
|
242
|
-
return "${
|
252
|
+
return "${messagesPerField.get('${fieldName}')?no_esc}";
|
243
253
|
<#recover>
|
244
|
-
return "
|
254
|
+
return "invalid field";
|
245
255
|
</#attempt>
|
256
|
+
|
246
257
|
</#if>
|
247
258
|
|
248
259
|
<#else>
|
249
260
|
|
250
|
-
|
251
|
-
|
252
|
-
<#recover>
|
253
|
-
return "invalid field";
|
254
|
-
</#attempt>
|
261
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
262
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
255
263
|
|
256
|
-
|
264
|
+
<#assign doExistErrorOnUsernameOrPassword = "">
|
257
265
|
|
258
|
-
|
266
|
+
<#attempt>
|
267
|
+
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
268
|
+
<#recover>
|
269
|
+
<#assign doExistErrorOnUsernameOrPassword = true>
|
270
|
+
</#attempt>
|
259
271
|
|
260
|
-
|
261
|
-
<#if '${fieldName}' == 'username' || '${fieldName}' == 'password'>
|
272
|
+
<#if doExistErrorOnUsernameOrPassword>
|
262
273
|
|
263
|
-
|
274
|
+
<#attempt>
|
275
|
+
return "${kcSanitize(msg('invalidUserMessage'))?no_esc}";
|
276
|
+
<#recover>
|
277
|
+
return "Invalid username or password.";
|
278
|
+
</#attempt>
|
264
279
|
|
265
|
-
|
266
|
-
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
267
|
-
<#recover>
|
268
|
-
<#assign doExistErrorOnUsernameOrPassword = true>
|
269
|
-
</#attempt>
|
280
|
+
<#else>
|
270
281
|
|
271
|
-
|
282
|
+
<#attempt>
|
283
|
+
return "${messagesPerField.get('${fieldName}')?no_esc}";
|
284
|
+
<#recover>
|
285
|
+
return "";
|
286
|
+
</#attempt>
|
272
287
|
|
273
|
-
|
274
|
-
return "${kcSanitize(msg('invalidUserMessage'))?no_esc}";
|
275
|
-
<#recover>
|
276
|
-
return "Invalid username or password.";
|
277
|
-
</#attempt>
|
288
|
+
</#if>
|
278
289
|
|
279
290
|
<#else>
|
280
291
|
|
281
292
|
<#attempt>
|
282
293
|
return "${messagesPerField.get('${fieldName}')?no_esc}";
|
283
294
|
<#recover>
|
284
|
-
return "";
|
295
|
+
return "invalid field";
|
285
296
|
</#attempt>
|
286
297
|
|
287
298
|
</#if>
|
288
299
|
|
289
|
-
<#else>
|
290
|
-
|
291
|
-
<#attempt>
|
292
|
-
return "${messagesPerField.get('${fieldName}')?no_esc}";
|
293
|
-
<#recover>
|
294
|
-
return "invalid field";
|
295
|
-
</#attempt>
|
296
|
-
|
297
300
|
</#if>
|
298
301
|
|
299
|
-
|
302
|
+
}
|
303
|
+
</#list>
|
300
304
|
|
301
|
-
|
302
|
-
</#list>
|
305
|
+
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
303
306
|
|
304
|
-
|
307
|
+
</#if>
|
305
308
|
|
306
309
|
},
|
307
310
|
"exists": function (fieldName) {
|
308
311
|
|
309
312
|
<#if !messagesPerField?? || !(messagesPerField?is_hash)>
|
310
313
|
throw new Error("You're not supposed to use messagesPerField.exists in this page");
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
if(fieldName === "${fieldName}" ){
|
314
|
+
<#else>
|
315
|
+
<#list fieldNames as fieldName>
|
316
|
+
if(fieldName === "${fieldName}" ){
|
315
317
|
|
316
|
-
|
317
|
-
|
318
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
319
|
+
<#if !messagesPerField.existsError??>
|
318
320
|
|
319
|
-
|
320
|
-
|
321
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
322
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
321
323
|
|
322
|
-
|
324
|
+
<#assign doExistMessageForUsernameOrPassword = "">
|
323
325
|
|
324
|
-
<#attempt>
|
325
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
326
|
-
<#recover>
|
327
|
-
<#assign doExistMessageForUsernameOrPassword = true>
|
328
|
-
</#attempt>
|
329
|
-
|
330
|
-
<#if !doExistMessageForUsernameOrPassword>
|
331
326
|
<#attempt>
|
332
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('
|
327
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
333
328
|
<#recover>
|
334
329
|
<#assign doExistMessageForUsernameOrPassword = true>
|
335
330
|
</#attempt>
|
336
|
-
</#if>
|
337
331
|
|
338
|
-
|
332
|
+
<#if !doExistMessageForUsernameOrPassword>
|
333
|
+
<#attempt>
|
334
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('password')>
|
335
|
+
<#recover>
|
336
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
337
|
+
</#attempt>
|
338
|
+
</#if>
|
339
339
|
|
340
|
-
|
340
|
+
return <#if doExistMessageForUsernameOrPassword>true<#else>false</#if>;
|
341
341
|
|
342
|
-
<#
|
342
|
+
<#else>
|
343
343
|
|
344
|
-
|
345
|
-
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
346
|
-
<#recover>
|
347
|
-
<#assign doExistMessageForField = true>
|
348
|
-
</#attempt>
|
344
|
+
<#assign doExistMessageForField = "">
|
349
345
|
|
350
|
-
|
346
|
+
<#attempt>
|
347
|
+
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
348
|
+
<#recover>
|
349
|
+
<#assign doExistMessageForField = true>
|
350
|
+
</#attempt>
|
351
351
|
|
352
|
-
|
352
|
+
return <#if doExistMessageForField>true<#else>false</#if>;
|
353
353
|
|
354
|
-
|
354
|
+
</#if>
|
355
355
|
|
356
|
-
|
357
|
-
<#if '${fieldName}' == 'username' || '${fieldName}' == 'password'>
|
356
|
+
<#else>
|
358
357
|
|
359
|
-
|
358
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
359
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
360
360
|
|
361
|
-
|
362
|
-
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
363
|
-
<#recover>
|
364
|
-
<#assign doExistErrorOnUsernameOrPassword = true>
|
365
|
-
</#attempt>
|
361
|
+
<#assign doExistErrorOnUsernameOrPassword = "">
|
366
362
|
|
367
|
-
|
363
|
+
<#attempt>
|
364
|
+
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
365
|
+
<#recover>
|
366
|
+
<#assign doExistErrorOnUsernameOrPassword = true>
|
367
|
+
</#attempt>
|
368
368
|
|
369
|
-
|
369
|
+
return <#if doExistErrorOnUsernameOrPassword>true<#else>false</#if>;
|
370
370
|
|
371
|
-
<#
|
371
|
+
<#else>
|
372
372
|
|
373
|
-
|
374
|
-
<#assign doExistErrorMessageForField = messagesPerField.exists('${fieldName}')>
|
375
|
-
<#recover>
|
376
|
-
<#assign doExistErrorMessageForField = true>
|
377
|
-
</#attempt>
|
373
|
+
<#assign doExistErrorMessageForField = "">
|
378
374
|
|
379
|
-
|
375
|
+
<#attempt>
|
376
|
+
<#assign doExistErrorMessageForField = messagesPerField.exists('${fieldName}')>
|
377
|
+
<#recover>
|
378
|
+
<#assign doExistErrorMessageForField = true>
|
379
|
+
</#attempt>
|
380
380
|
|
381
|
-
|
381
|
+
return <#if doExistErrorMessageForField>true<#else>false</#if>;
|
382
382
|
|
383
|
-
|
383
|
+
</#if>
|
384
384
|
|
385
|
-
|
386
|
-
</#list>
|
385
|
+
</#if>
|
387
386
|
|
388
|
-
|
387
|
+
}
|
388
|
+
</#list>
|
389
|
+
|
390
|
+
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
391
|
+
</#if>
|
389
392
|
|
390
393
|
}
|
391
394
|
};
|
@@ -9,12 +9,7 @@ import { emailRegexp } from "../../tools/emailRegExp";
|
|
9
9
|
* artificial password related attributes only if kcContext.passwordRequired === true
|
10
10
|
*/
|
11
11
|
export function useFormValidation(params) {
|
12
|
-
const { kcContext, passwordValidators = {
|
13
|
-
"length": {
|
14
|
-
"ignore.empty.value": true,
|
15
|
-
"min": "4"
|
16
|
-
}
|
17
|
-
}, i18n } = params;
|
12
|
+
const { kcContext, passwordValidators = {}, i18n } = params;
|
18
13
|
const attributesWithPassword = useMemo(() => !kcContext.passwordRequired
|
19
14
|
? kcContext.profile.attributes
|
20
15
|
: (() => {
|
@@ -121,7 +116,7 @@ function useGetErrors(params) {
|
|
121
116
|
const { value } = fieldValueByAttributeName[name];
|
122
117
|
const { value: defaultValue, validators } = attributes.find(attribute => attribute.name === name);
|
123
118
|
block: {
|
124
|
-
if (defaultValue !== value) {
|
119
|
+
if ((defaultValue !== null && defaultValue !== void 0 ? defaultValue : "") !== value) {
|
125
120
|
break block;
|
126
121
|
}
|
127
122
|
let doesErrorExist;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useFormValidation.js","sourceRoot":"","sources":["../../src/login/lib/useFormValidation.tsx"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAG9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAI5D;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAYjC;IACG,MAAM,EACF,SAAS,EACT,kBAAkB,GAAG;QACjB,QAAQ,EAAE;YACN,oBAAoB,EAAE,IAAI;YAC1B,KAAK,EAAE,GAAG;SACb;KACJ,EACD,IAAI,EACP,GAAG,MAAM,CAAC;IAEX,MAAM,sBAAsB,GAAG,OAAO,CAClC,GAAG,EAAE,CACD,CAAC,SAAS,CAAC,gBAAgB;QACvB,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU;QAC9B,CAAC,CAAC,CAAC,GAAG,EAAE;YACF,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;YAEhF,OAAO,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CACtC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;gBACZ,GAAG,IAAI;gBACP,GAAG,CAAC,IAAI,CAAC,IAAI,K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AC,KAAK,CAAC,IAAI,CAAC,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,OAAO,GAAG,CAAC,EAAE,CAAa,iBAAiB,CAAC,CAAU,CAAC;YAE7D,MAAM,CAAC,IAAI,CAAC;gBACR,aAAa;gBACb,cAAc,EAAE,KAAC,QAAQ,cAAsB,WAAW,CAAC,GAAG,OAAO,CAAC,IAAvC,MAAM,CAAC,MAAM,CAAsC;gBAClF,iBAAiB,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC;aAChD,CAAC,CAAC;SACN;QAED,qCAAqC;QAErC,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,SAAS,EAAE,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
@@ -26,64 +26,77 @@
|
|
26
26
|
|
27
27
|
<#if !messagesPerField?? || !(messagesPerField?is_hash)>
|
28
28
|
throw new Error("You're not supposed to use messagesPerField.printIfExists in this page");
|
29
|
-
|
29
|
+
<#else>
|
30
|
+
<#list fieldNames as fieldName>
|
31
|
+
if(fieldName === "${fieldName}" ){
|
32
|
+
|
33
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
34
|
+
<#if !messagesPerField.existsError??>
|
30
35
|
|
31
|
-
|
32
|
-
|
36
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
37
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
33
38
|
|
34
|
-
|
35
|
-
|
39
|
+
<#assign doExistMessageForUsernameOrPassword = "">
|
40
|
+
|
41
|
+
<#attempt>
|
42
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
43
|
+
<#recover>
|
44
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
45
|
+
</#attempt>
|
36
46
|
|
37
|
-
|
38
|
-
|
47
|
+
<#if !doExistMessageForUsernameOrPassword>
|
48
|
+
<#attempt>
|
49
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('password')>
|
50
|
+
<#recover>
|
51
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
52
|
+
</#attempt>
|
53
|
+
</#if>
|
39
54
|
|
40
|
-
|
55
|
+
return <#if doExistMessageForUsernameOrPassword>text<#else>undefined</#if>;
|
41
56
|
|
42
|
-
<#
|
43
|
-
|
44
|
-
|
45
|
-
<#assign doExistMessageForUsernameOrPassword = true>
|
46
|
-
</#attempt>
|
57
|
+
<#else>
|
58
|
+
|
59
|
+
<#assign doExistMessageForField = "">
|
47
60
|
|
48
|
-
<#if !doExistMessageForUsernameOrPassword>
|
49
61
|
<#attempt>
|
50
|
-
<#assign
|
62
|
+
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
51
63
|
<#recover>
|
52
|
-
<#assign
|
64
|
+
<#assign doExistMessageForField = true>
|
53
65
|
</#attempt>
|
54
|
-
</#if>
|
55
66
|
|
56
|
-
|
67
|
+
return <#if doExistMessageForField>text<#else>undefined</#if>;
|
68
|
+
|
69
|
+
</#if>
|
57
70
|
|
58
71
|
<#else>
|
59
72
|
|
60
|
-
|
73
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
74
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
61
75
|
|
62
|
-
|
63
|
-
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
64
|
-
<#recover>
|
65
|
-
<#assign doExistMessageForField = true>
|
66
|
-
</#attempt>
|
76
|
+
<#assign doExistErrorOnUsernameOrPassword = "">
|
67
77
|
|
68
|
-
|
78
|
+
<#attempt>
|
79
|
+
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
80
|
+
<#recover>
|
81
|
+
<#assign doExistErrorOnUsernameOrPassword = true>
|
82
|
+
</#attempt>
|
69
83
|
|
70
|
-
|
84
|
+
<#if doExistErrorOnUsernameOrPassword>
|
85
|
+
return text;
|
86
|
+
<#else>
|
71
87
|
|
72
|
-
|
88
|
+
<#assign doExistMessageForField = "">
|
73
89
|
|
74
|
-
|
75
|
-
|
90
|
+
<#attempt>
|
91
|
+
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
92
|
+
<#recover>
|
93
|
+
<#assign doExistMessageForField = true>
|
94
|
+
</#attempt>
|
76
95
|
|
77
|
-
|
96
|
+
return <#if doExistMessageForField>text<#else>undefined</#if>;
|
78
97
|
|
79
|
-
|
80
|
-
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
81
|
-
<#recover>
|
82
|
-
<#assign doExistErrorOnUsernameOrPassword = true>
|
83
|
-
</#attempt>
|
98
|
+
</#if>
|
84
99
|
|
85
|
-
<#if doExistErrorOnUsernameOrPassword>
|
86
|
-
return text;
|
87
100
|
<#else>
|
88
101
|
|
89
102
|
<#assign doExistMessageForField = "">
|
@@ -98,109 +111,98 @@
|
|
98
111
|
|
99
112
|
</#if>
|
100
113
|
|
101
|
-
<#else>
|
102
|
-
|
103
|
-
<#assign doExistMessageForField = "">
|
104
|
-
|
105
|
-
<#attempt>
|
106
|
-
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
107
|
-
<#recover>
|
108
|
-
<#assign doExistMessageForField = true>
|
109
|
-
</#attempt>
|
110
|
-
|
111
|
-
return <#if doExistMessageForField>text<#else>undefined</#if>;
|
112
|
-
|
113
114
|
</#if>
|
114
115
|
|
115
|
-
|
116
|
+
}
|
117
|
+
</#list>
|
116
118
|
|
117
|
-
|
118
|
-
</#
|
119
|
+
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
120
|
+
</#if>
|
119
121
|
|
120
|
-
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
121
122
|
},
|
122
123
|
"existsError": function (fieldName) {
|
123
124
|
|
124
125
|
<#if !messagesPerField?? || !(messagesPerField?is_hash)>
|
125
126
|
throw new Error("You're not supposed to use messagesPerField.printIfExists in this page");
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
if(fieldName === "${fieldName}" ){
|
130
|
-
|
131
|
-
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
132
|
-
<#if !messagesPerField.existsError??>
|
127
|
+
<#else>
|
128
|
+
<#list fieldNames as fieldName>
|
129
|
+
if(fieldName === "${fieldName}" ){
|
133
130
|
|
134
|
-
<#-- https://github.com/keycloakify/keycloakify/pull/
|
135
|
-
<#if
|
131
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
132
|
+
<#if !messagesPerField.existsError??>
|
136
133
|
|
137
|
-
|
134
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
135
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
138
136
|
|
139
|
-
|
140
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
141
|
-
<#recover>
|
142
|
-
<#assign doExistMessageForUsernameOrPassword = true>
|
143
|
-
</#attempt>
|
137
|
+
<#assign doExistMessageForUsernameOrPassword = "">
|
144
138
|
|
145
|
-
<#if !doExistMessageForUsernameOrPassword>
|
146
139
|
<#attempt>
|
147
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('
|
140
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
148
141
|
<#recover>
|
149
142
|
<#assign doExistMessageForUsernameOrPassword = true>
|
150
143
|
</#attempt>
|
151
|
-
</#if>
|
152
144
|
|
153
|
-
|
145
|
+
<#if !doExistMessageForUsernameOrPassword>
|
146
|
+
<#attempt>
|
147
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('password')>
|
148
|
+
<#recover>
|
149
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
150
|
+
</#attempt>
|
151
|
+
</#if>
|
154
152
|
|
155
|
-
|
153
|
+
return <#if doExistMessageForUsernameOrPassword>true<#else>false</#if>;
|
156
154
|
|
157
|
-
<#
|
155
|
+
<#else>
|
158
156
|
|
159
|
-
|
160
|
-
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
161
|
-
<#recover>
|
162
|
-
<#assign doExistMessageForField = true>
|
163
|
-
</#attempt>
|
157
|
+
<#assign doExistMessageForField = "">
|
164
158
|
|
165
|
-
|
159
|
+
<#attempt>
|
160
|
+
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
161
|
+
<#recover>
|
162
|
+
<#assign doExistMessageForField = true>
|
163
|
+
</#attempt>
|
166
164
|
|
167
|
-
|
165
|
+
return <#if doExistMessageForField>true<#else>false</#if>;
|
168
166
|
|
169
|
-
|
167
|
+
</#if>
|
170
168
|
|
171
|
-
|
172
|
-
<#if '${fieldName}' == 'username' || '${fieldName}' == 'password'>
|
169
|
+
<#else>
|
173
170
|
|
174
|
-
|
171
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
172
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
175
173
|
|
176
|
-
|
177
|
-
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
178
|
-
<#recover>
|
179
|
-
<#assign doExistErrorOnUsernameOrPassword = true>
|
180
|
-
</#attempt>
|
174
|
+
<#assign doExistErrorOnUsernameOrPassword = "">
|
181
175
|
|
182
|
-
|
176
|
+
<#attempt>
|
177
|
+
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
178
|
+
<#recover>
|
179
|
+
<#assign doExistErrorOnUsernameOrPassword = true>
|
180
|
+
</#attempt>
|
183
181
|
|
184
|
-
|
182
|
+
return <#if doExistErrorOnUsernameOrPassword>true<#else>false</#if>;
|
183
|
+
|
184
|
+
<#else>
|
185
185
|
|
186
|
-
|
186
|
+
<#assign doExistErrorMessageForField = "">
|
187
187
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
188
|
+
<#attempt>
|
189
|
+
<#assign doExistErrorMessageForField = messagesPerField.existsError('${fieldName}')>
|
190
|
+
<#recover>
|
191
|
+
<#assign doExistErrorMessageForField = true>
|
192
|
+
</#attempt>
|
193
193
|
|
194
|
-
|
194
|
+
return <#if doExistErrorMessageForField>true<#else>false</#if>;
|
195
|
+
|
196
|
+
</#if>
|
195
197
|
|
196
198
|
</#if>
|
197
199
|
|
198
|
-
|
200
|
+
}
|
201
|
+
</#list>
|
199
202
|
|
200
|
-
|
201
|
-
</#list>
|
203
|
+
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
202
204
|
|
203
|
-
|
205
|
+
</#if>
|
204
206
|
|
205
207
|
},
|
206
208
|
"get": function (fieldName) {
|
@@ -208,184 +210,185 @@
|
|
208
210
|
|
209
211
|
<#if !messagesPerField?? || !(messagesPerField?is_hash)>
|
210
212
|
throw new Error("You're not supposed to use messagesPerField.get in this page");
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
if(fieldName === "${fieldName}" ){
|
213
|
+
<#else>
|
214
|
+
<#list fieldNames as fieldName>
|
215
|
+
if(fieldName === "${fieldName}" ){
|
215
216
|
|
216
|
-
|
217
|
-
|
217
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
218
|
+
<#if !messagesPerField.existsError??>
|
218
219
|
|
219
|
-
|
220
|
-
|
220
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
221
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
221
222
|
|
222
|
-
|
223
|
+
<#assign doExistMessageForUsernameOrPassword = "">
|
223
224
|
|
224
|
-
<#attempt>
|
225
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
226
|
-
<#recover>
|
227
|
-
<#assign doExistMessageForUsernameOrPassword = true>
|
228
|
-
</#attempt>
|
229
|
-
|
230
|
-
<#if !doExistMessageForUsernameOrPassword>
|
231
225
|
<#attempt>
|
232
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('
|
226
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
233
227
|
<#recover>
|
234
228
|
<#assign doExistMessageForUsernameOrPassword = true>
|
235
229
|
</#attempt>
|
236
|
-
</#if>
|
237
230
|
|
238
|
-
|
239
|
-
|
231
|
+
<#if !doExistMessageForUsernameOrPassword>
|
232
|
+
<#attempt>
|
233
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('password')>
|
234
|
+
<#recover>
|
235
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
236
|
+
</#attempt>
|
237
|
+
</#if>
|
238
|
+
|
239
|
+
<#if !doExistMessageForUsernameOrPassword>
|
240
|
+
return "";
|
241
|
+
<#else>
|
242
|
+
<#attempt>
|
243
|
+
return "${kcSanitize(msg('invalidUserMessage'))?no_esc}";
|
244
|
+
<#recover>
|
245
|
+
return "Invalid username or password.";
|
246
|
+
</#attempt>
|
247
|
+
</#if>
|
248
|
+
|
240
249
|
<#else>
|
250
|
+
|
241
251
|
<#attempt>
|
242
|
-
return "${
|
252
|
+
return "${messagesPerField.get('${fieldName}')?no_esc}";
|
243
253
|
<#recover>
|
244
|
-
return "
|
254
|
+
return "invalid field";
|
245
255
|
</#attempt>
|
256
|
+
|
246
257
|
</#if>
|
247
258
|
|
248
259
|
<#else>
|
249
260
|
|
250
|
-
|
251
|
-
|
252
|
-
<#recover>
|
253
|
-
return "invalid field";
|
254
|
-
</#attempt>
|
261
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
262
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
255
263
|
|
256
|
-
|
264
|
+
<#assign doExistErrorOnUsernameOrPassword = "">
|
257
265
|
|
258
|
-
|
266
|
+
<#attempt>
|
267
|
+
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
268
|
+
<#recover>
|
269
|
+
<#assign doExistErrorOnUsernameOrPassword = true>
|
270
|
+
</#attempt>
|
259
271
|
|
260
|
-
|
261
|
-
<#if '${fieldName}' == 'username' || '${fieldName}' == 'password'>
|
272
|
+
<#if doExistErrorOnUsernameOrPassword>
|
262
273
|
|
263
|
-
|
274
|
+
<#attempt>
|
275
|
+
return "${kcSanitize(msg('invalidUserMessage'))?no_esc}";
|
276
|
+
<#recover>
|
277
|
+
return "Invalid username or password.";
|
278
|
+
</#attempt>
|
264
279
|
|
265
|
-
|
266
|
-
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
267
|
-
<#recover>
|
268
|
-
<#assign doExistErrorOnUsernameOrPassword = true>
|
269
|
-
</#attempt>
|
280
|
+
<#else>
|
270
281
|
|
271
|
-
|
282
|
+
<#attempt>
|
283
|
+
return "${messagesPerField.get('${fieldName}')?no_esc}";
|
284
|
+
<#recover>
|
285
|
+
return "";
|
286
|
+
</#attempt>
|
272
287
|
|
273
|
-
|
274
|
-
return "${kcSanitize(msg('invalidUserMessage'))?no_esc}";
|
275
|
-
<#recover>
|
276
|
-
return "Invalid username or password.";
|
277
|
-
</#attempt>
|
288
|
+
</#if>
|
278
289
|
|
279
290
|
<#else>
|
280
291
|
|
281
292
|
<#attempt>
|
282
293
|
return "${messagesPerField.get('${fieldName}')?no_esc}";
|
283
294
|
<#recover>
|
284
|
-
return "";
|
295
|
+
return "invalid field";
|
285
296
|
</#attempt>
|
286
297
|
|
287
298
|
</#if>
|
288
299
|
|
289
|
-
<#else>
|
290
|
-
|
291
|
-
<#attempt>
|
292
|
-
return "${messagesPerField.get('${fieldName}')?no_esc}";
|
293
|
-
<#recover>
|
294
|
-
return "invalid field";
|
295
|
-
</#attempt>
|
296
|
-
|
297
300
|
</#if>
|
298
301
|
|
299
|
-
|
302
|
+
}
|
303
|
+
</#list>
|
300
304
|
|
301
|
-
|
302
|
-
</#list>
|
305
|
+
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
303
306
|
|
304
|
-
|
307
|
+
</#if>
|
305
308
|
|
306
309
|
},
|
307
310
|
"exists": function (fieldName) {
|
308
311
|
|
309
312
|
<#if !messagesPerField?? || !(messagesPerField?is_hash)>
|
310
313
|
throw new Error("You're not supposed to use messagesPerField.exists in this page");
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
if(fieldName === "${fieldName}" ){
|
314
|
+
<#else>
|
315
|
+
<#list fieldNames as fieldName>
|
316
|
+
if(fieldName === "${fieldName}" ){
|
315
317
|
|
316
|
-
|
317
|
-
|
318
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/359 Compat with Keycloak prior v12 -->
|
319
|
+
<#if !messagesPerField.existsError??>
|
318
320
|
|
319
|
-
|
320
|
-
|
321
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
322
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
321
323
|
|
322
|
-
|
324
|
+
<#assign doExistMessageForUsernameOrPassword = "">
|
323
325
|
|
324
|
-
<#attempt>
|
325
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
326
|
-
<#recover>
|
327
|
-
<#assign doExistMessageForUsernameOrPassword = true>
|
328
|
-
</#attempt>
|
329
|
-
|
330
|
-
<#if !doExistMessageForUsernameOrPassword>
|
331
326
|
<#attempt>
|
332
|
-
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('
|
327
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('username')>
|
333
328
|
<#recover>
|
334
329
|
<#assign doExistMessageForUsernameOrPassword = true>
|
335
330
|
</#attempt>
|
336
|
-
</#if>
|
337
331
|
|
338
|
-
|
332
|
+
<#if !doExistMessageForUsernameOrPassword>
|
333
|
+
<#attempt>
|
334
|
+
<#assign doExistMessageForUsernameOrPassword = messagesPerField.exists('password')>
|
335
|
+
<#recover>
|
336
|
+
<#assign doExistMessageForUsernameOrPassword = true>
|
337
|
+
</#attempt>
|
338
|
+
</#if>
|
339
339
|
|
340
|
-
|
340
|
+
return <#if doExistMessageForUsernameOrPassword>true<#else>false</#if>;
|
341
341
|
|
342
|
-
<#
|
342
|
+
<#else>
|
343
343
|
|
344
|
-
|
345
|
-
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
346
|
-
<#recover>
|
347
|
-
<#assign doExistMessageForField = true>
|
348
|
-
</#attempt>
|
344
|
+
<#assign doExistMessageForField = "">
|
349
345
|
|
350
|
-
|
346
|
+
<#attempt>
|
347
|
+
<#assign doExistMessageForField = messagesPerField.exists('${fieldName}')>
|
348
|
+
<#recover>
|
349
|
+
<#assign doExistMessageForField = true>
|
350
|
+
</#attempt>
|
351
351
|
|
352
|
-
|
352
|
+
return <#if doExistMessageForField>true<#else>false</#if>;
|
353
353
|
|
354
|
-
|
354
|
+
</#if>
|
355
355
|
|
356
|
-
|
357
|
-
<#if '${fieldName}' == 'username' || '${fieldName}' == 'password'>
|
356
|
+
<#else>
|
358
357
|
|
359
|
-
|
358
|
+
<#-- https://github.com/keycloakify/keycloakify/pull/218 -->
|
359
|
+
<#if ('${fieldName}' == 'username' || '${fieldName}' == 'password') && pageId != 'register.ftl' && pageId != 'register-user-profile.ftl'>
|
360
360
|
|
361
|
-
|
362
|
-
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
363
|
-
<#recover>
|
364
|
-
<#assign doExistErrorOnUsernameOrPassword = true>
|
365
|
-
</#attempt>
|
361
|
+
<#assign doExistErrorOnUsernameOrPassword = "">
|
366
362
|
|
367
|
-
|
363
|
+
<#attempt>
|
364
|
+
<#assign doExistErrorOnUsernameOrPassword = messagesPerField.existsError('username', 'password')>
|
365
|
+
<#recover>
|
366
|
+
<#assign doExistErrorOnUsernameOrPassword = true>
|
367
|
+
</#attempt>
|
368
368
|
|
369
|
-
|
369
|
+
return <#if doExistErrorOnUsernameOrPassword>true<#else>false</#if>;
|
370
370
|
|
371
|
-
<#
|
371
|
+
<#else>
|
372
372
|
|
373
|
-
|
374
|
-
<#assign doExistErrorMessageForField = messagesPerField.exists('${fieldName}')>
|
375
|
-
<#recover>
|
376
|
-
<#assign doExistErrorMessageForField = true>
|
377
|
-
</#attempt>
|
373
|
+
<#assign doExistErrorMessageForField = "">
|
378
374
|
|
379
|
-
|
375
|
+
<#attempt>
|
376
|
+
<#assign doExistErrorMessageForField = messagesPerField.exists('${fieldName}')>
|
377
|
+
<#recover>
|
378
|
+
<#assign doExistErrorMessageForField = true>
|
379
|
+
</#attempt>
|
380
380
|
|
381
|
-
|
381
|
+
return <#if doExistErrorMessageForField>true<#else>false</#if>;
|
382
382
|
|
383
|
-
|
383
|
+
</#if>
|
384
384
|
|
385
|
-
|
386
|
-
</#list>
|
385
|
+
</#if>
|
387
386
|
|
388
|
-
|
387
|
+
}
|
388
|
+
</#list>
|
389
|
+
|
390
|
+
throw new Error(fieldName + "is probably runtime generated, see: https://docs.keycloakify.dev/limitations#field-names-cant-be-runtime-generated");
|
391
|
+
</#if>
|
389
392
|
|
390
393
|
}
|
391
394
|
};
|
@@ -25,16 +25,7 @@ export function useFormValidation(params: {
|
|
25
25
|
passwordValidators?: Validators;
|
26
26
|
i18n: I18n;
|
27
27
|
}) {
|
28
|
-
const {
|
29
|
-
kcContext,
|
30
|
-
passwordValidators = {
|
31
|
-
"length": {
|
32
|
-
"ignore.empty.value": true,
|
33
|
-
"min": "4"
|
34
|
-
}
|
35
|
-
},
|
36
|
-
i18n
|
37
|
-
} = params;
|
28
|
+
const { kcContext, passwordValidators = {}, i18n } = params;
|
38
29
|
|
39
30
|
const attributesWithPassword = useMemo(
|
40
31
|
() =>
|
@@ -211,7 +202,7 @@ function useGetErrors(params: {
|
|
211
202
|
const { value: defaultValue, validators } = attributes.find(attribute => attribute.name === name)!;
|
212
203
|
|
213
204
|
block: {
|
214
|
-
if (defaultValue !== value) {
|
205
|
+
if ((defaultValue ?? "") !== value) {
|
215
206
|
break block;
|
216
207
|
}
|
217
208
|
|