我正在使用 webflow 构建一个网站,并且正在添加身份验证。我已经设法添加了所有基本代码来启用电子邮件登录。用户成功登录后出现问题,当我专门将主页添加为重定向站点(在“signInSuccessUrl”之后指定)时,导致重定向到空白页面。有谁知道为什么会这样?
在正文之前,标记
<script type="text/javascript">
// FirebaseUI config.
var uiConfig = {
signInSuccessUrl: '<http://lundaspexarnas-superb-project.webflow.io/>',
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.EmailAuthProvider.PROVIDER_ID,
],
// Terms of service url.
tosUrl: '<your-tos-url>'
};
// Initialize the FirebaseUI Widget using Firebase.
var ui = new firebaseui.auth.AuthUI(firebase.auth());
// The start method will wait until the DOM is loaded.
ui.start('#firebaseui-auth-container', uiConfig);
</script>
在头部之前,标记
<script src="https://cdn.firebase.com/libs/firebaseui/2.7.0/firebaseui.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/2.7.0/firebaseui.css" />
所有页面上的头代码
<script src="https://www.gstatic.com/firebasejs/4.12.1/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
Config details
};
firebase.initializeApp(config);
</script>