-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp4.js
29 lines (25 loc) · 883 Bytes
/
app4.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(function (){
document.getElementById('eventClick').onclick= function(){
document.getElementById('ClickMe').innerHTML++;
}
const config = {
apiKey: "AIzaSyByiVZCx2lMwJerAGR6TkgLXhozKvEwrO8",
authDomain: "silent-relic-219002.firebaseapp.com",
databaseURL: "https://silent-relic-219002.firebaseio.com",
projectId: "silent-relic-219002",
storageBucket: "silent-relic-219002.appspot.com",
messagingSenderId: "515739637546"
};
firebase.initializeApp(config);
//Auth listener
firebase.auth().onAuthStateChanged(firebaseUser => {
console.log(firebaseUser);
if(firebaseUser){
alert("Congratulations! You are logged in!");
}
else{
document.getElementById('eventClick').style.display = 'none';
alert("You are not logged in! Access denied!");
}
});
}());