0
내 웹 사이트에 Firebase 인증을 추가하려고했습니다.Firebase 웹 인증이 작동하지 않습니다.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>
Sample FirebaseUI App
</title>
<!-- ******************************************************************************************* * TODO(DEVELOPER): Paste the initialization snippet from: * Firebase Console > Overview > Add Firebase to your web app. * ***************************************************************************************** -->
<script type="text/javascript">
// Initialize Firebase
var config = {
apiKey: "AIzaSyB7cfgbxS4UgkGwsHyFgYwa6Ir7eRTWHM0",
authDomain: "web-teachinger.firebaseapp.com",
databaseURL: "https://web-teachinger.firebaseio.com",
projectId: "web-teachinger",
storageBucket: "",
messagingSenderId: "1070392376591"
};
firebase.initializeApp(config);
</script>
<script src="https://cdn.firebase.com/libs/firebaseui/2.5.1/firebaseui.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/2.5.1/firebaseui.css" />
<script type="text/javascript">
firebase.initializeApp(config);
// FirebaseUI config.
var uiConfig = {
signInSuccessUrl: 'success.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,
firebase.auth.EmailAuthProvider.PROVIDER_ID,
firebase.auth.PhoneAuthProvider.PROVIDER_ID
],
// Terms of service url.
tosUrl: 'TOS.php' };
// 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>
</head>
<body>
<!-- The surrounding HTML is left untouched by FirebaseUI. Your app may use that space for branding, controls and other customizations.-->
<h1>
Welcome to My Awesome App
</h1>
<div id="firebaseui-auth-container">
</div>
</body>
</html>
하지만 로컬 호스트를 방문 할 때, 그냥없이 인증 제공자 "내 최고 앱에 오신 것을 환영합니다"를 보여주는 것하고 볼 수없는 용기 : 나는이 코드를 시도했다. 도와주세요 참고 : Localhost에서이 코드를 테스트 할 수도 있습니다. Uncaught ReferenceError: firebase is not defined
당신은 중포 기지 JS CDN 포함되지 않습니다 :
코드 https://teachinger.cu.ma/auth/에 업로드 – user8984670