@@ -192,7 +192,7 @@ function getEmailAddressField({
192
192
return ;
193
193
}
194
194
195
- const { emailShouldBeRequired } = determineRequiredCommunicationMethod ( attributes ) ;
195
+ const { emailShouldBeRequired } = determineRequiredIdentifier ( attributes ) ;
196
196
197
197
return {
198
198
required : emailShouldBeRequired ,
@@ -324,15 +324,15 @@ const outcomePredicates: Record<Outcome, ((ctx: Context) => boolean)[]> = {
324
324
mirrorServer : [
325
325
// If password is not required, then field requirements are determined by the server.
326
326
ctx => ! ctx . passwordRequired ,
327
- // If any of the communication methods are already required by the server, then we don't need to do anything.
327
+ // If any of the identifiers are already required by the server, then we don't need to do anything.
328
328
ctx => ctx . email . required || ctx . phone . required || ( ctx . username . required && ctx . username . firstFactor ) ,
329
329
] ,
330
330
none : [
331
- // If none of the communication methods are enabled, then none can be required.
331
+ // If none of the identifiers are enabled, then none can be required.
332
332
ctx => ! ctx . email . enabled && ! ctx . phone . enabled && ! ctx . username . enabled ,
333
333
] ,
334
334
email : [
335
- // If email is the only enabled communication method , it should be required.
335
+ // If email is the only enabled identifier , it should be required.
336
336
ctx => ctx . email . enabled && ! ctx . phone . enabled && ! ctx . username . enabled ,
337
337
// If email is enabled but not required, and phone is enabled and not required, then email should be required.
338
338
ctx => ctx . email . enabled && ! ctx . email . required && ctx . phone . enabled && ! ctx . phone . required ,
@@ -364,7 +364,7 @@ const outcomePredicates: Record<Outcome, ((ctx: Context) => boolean)[]> = {
364
364
* When password is required, we need to ensure at least one identifier
365
365
* (email, phone, or username) is also required
366
366
*/
367
- export function determineRequiredCommunicationMethod ( attributes : Partial < Attributes > ) : {
367
+ export function determineRequiredIdentifier ( attributes : Partial < Attributes > ) : {
368
368
emailShouldBeRequired : boolean ;
369
369
phoneShouldBeRequired : boolean ;
370
370
usernameShouldBeRequired : boolean ;
@@ -410,7 +410,7 @@ export function determineRequiredCommunicationMethod(attributes: Partial<Attribu
410
410
const phoneShouldBeRequired = outcomeMet ( 'phone' ) ;
411
411
const usernameShouldBeRequired = outcomeMet ( 'username' ) ;
412
412
413
- // If password is required and no communication method is enabled, then email is the default.
413
+ // If password is required and no identifier is enabled, then email is the default.
414
414
if ( ctx . passwordRequired && ! emailShouldBeRequired && ! phoneShouldBeRequired && ! usernameShouldBeRequired ) {
415
415
return {
416
416
emailShouldBeRequired : true ,
0 commit comments