@@ -1417,19 +1417,29 @@ firebaseui.auth.widget.handler.common.handleSignInFetchSignInMethodsForEmail =
14171417 opt_displayFullTosPpMessage ) ;
14181418 } else if ( ( signInMethods . length == 1 ) && ( signInMethods [ 0 ] ===
14191419 firebase . auth . EmailAuthProvider . EMAIL_LINK_SIGN_IN_METHOD ) ) {
1420- // Existing email link account.
1421- firebaseui . auth . widget . handler . handle (
1422- firebaseui . auth . widget . HandlerName . SEND_EMAIL_LINK_FOR_SIGN_IN ,
1423- app ,
1424- container ,
1425- email ,
1426- function ( ) {
1427- // Clicking back button goes back to sign in page.
1428- firebaseui . auth . widget . handler . handle (
1429- firebaseui . auth . widget . HandlerName . SIGN_IN ,
1430- app ,
1431- container ) ;
1432- } ) ;
1420+ if ( app . getConfig ( ) . isEmailLinkSignInAllowed ( ) ) {
1421+ // Existing email link account.
1422+ firebaseui . auth . widget . handler . handle (
1423+ firebaseui . auth . widget . HandlerName . SEND_EMAIL_LINK_FOR_SIGN_IN ,
1424+ app ,
1425+ container ,
1426+ email ,
1427+ function ( ) {
1428+ // Clicking back button goes back to sign in page.
1429+ firebaseui . auth . widget . handler . handle (
1430+ firebaseui . auth . widget . HandlerName . SIGN_IN ,
1431+ app ,
1432+ container ) ;
1433+ } ) ;
1434+ } else {
1435+ // Email link sign-in is the only option for this user but it is not
1436+ // supported in the current app configuration.
1437+ firebaseui . auth . widget . handler . handle (
1438+ firebaseui . auth . widget . HandlerName . UNSUPPORTED_PROVIDER ,
1439+ app ,
1440+ container ,
1441+ email ) ;
1442+ }
14331443 } else {
14341444 // Federated Account.
14351445 // The account exists, and is a federated identity account.
0 commit comments