T
T
The-TS2020-05-11 14:32:09
JavaScript
The-TS, 2020-05-11 14:32:09

Email Link and FireBaseUI, how to fix?

I have this code:

<!DOCTYPE html>
<html>
  <head>
    <title>TEST_PAGE - BETA1</title>
        <link rel="stylesheet" type="text/css" href="/src/_example.css">
        <script src="https://cdn.firebase.com/libs/firebaseui/3.5.2/firebaseui.js"></script>
  		<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/3.5.2/firebaseui.css"/>
  </head>
  <body>
    <!-- Скрипты -->
    <script src="/__/firebase/7.14.2/firebase-app.js"></script>
    <script src="/__/firebase/7.14.2/firebase-analytics.js"></script>
    <script src="/__/firebase/7.14.2/firebase-auth.js"></script>
    <script src="/__/firebase/7.14.2/firebase-firestore.js"></script>
    <script src="/__/firebase/init.js"></script>
    <!-- /Скрипты -->

    <div class="Main_TSF">
      <div class="Caption_Text">
        TS-Forms
      </div>
    </div>
    <hr>
    <div class="Reccomend_TSF">
      <div class="Reccomend-text_TSF">
        <p>Типа ЗАголовок!</p>
        <hr id="hr_text">
        <p>Тира краткое содержание!</p>
        <span id="LINE"></span>
        <img id="_USER-img" src="https://www.w3schools.com/css/paris.jpg" alt="альтернативный текст">
        <p id="_USER-name">Admin_TS</p>
      </div>
    </div>
    <div class="Register_or_Login">
      <script>
      var ui = new firebaseui.auth.AuthUI(firebase.auth());
      var uiConfig = {
        callbacks: {
          signInSuccessWithAuthResult: function(authResult, redirectUrl) {
            // User successfully signed in.
            // Return type determines whether we continue the redirect automatically
            // or whether we leave that to developer to handle.
            return true;
          },
          uiShown: function() {
            // The widget is rendered.
            // Hide the loader.
            document.getElementById('loader').style.display = 'none';
          }
        },
        // Will use popup for IDP Providers sign-in flow instead of the default, redirect.
        signInFlow: 'popup',
        signInSuccessUrl: '../src/signInSuccessUrl.html',
        signInOptions: [
          // Leave the lines as is for the providers you want to offer your users.
          firebase.auth.GoogleAuthProvider.PROVIDER_ID,
          firebase.auth.FacebookAuthProvider.PROVIDER_ID,
          firebase.auth.TwitterAuthProvider.PROVIDER_ID,
          firebase.auth.GithubAuthProvider.PROVIDER_ID,
          provider: firebase.auth.EmailAuthProvider.PROVIDER_ID,
      	signInMethod: firebase.auth.EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD,
          firebase.auth.PhoneAuthProvider.PROVIDER_ID
        ],
        // Terms of service url.
        tosUrl: '../src/TermsofService.html',
        // Privacy policy url.
        privacyPolicyUrl: '../src/privacyPolicyUrl.html'
      };

      // Есть ли ссылка для входа по электронной почте?
      if (ui.isPendingRedirect()) {
        ui.start('#firebaseui-auth-container', uiConfig);
      }
      // Это также можно сделать через:
      if ((firebase.auth().isSignInWithEmailLink(window.location.href))) {
        ui.start('#firebaseui-auth-container', uiConfig);
      }

      ui.start('#firebaseui-auth-container', uiConfig);

      </script>
  			<div id="firebaseui-auth-container"></div>
    </div>
  </body>
</html>

As a result, for some reason the email link does not work, can you help?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question