-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
46 lines (43 loc) · 1.18 KB
/
test.html
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<head>
<script src="https://www.gstatic.com/firebasejs/3.2.1/firebase.js"></script>
<script>
var config = {
apiKey: "AIzaSyDurIg4ju49jQx_e5iKBLLbjTn3Q2SYPAk",
authDomain: "bharatham-125d6.firebaseapp.com",
databaseURL: "https://bharatham-125d6.firebaseio.com",
storageBucket: "bharatham-125d6.appspot.com",
};
firebase.initializeApp(config);
firebase.auth().signInWithEmailAndPassword('[email protected]', 'jovinbabu').catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log(errorCode);
});
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// User is signed in
user.updateProfile({
displayName: "Vikings",
}).then(function() {
// Update successful.
}, function(error) {
// An error happened.
});
} else {
// No user is signed in.
console.log("No One");
}
});
firebase.auth().signOut().then(function() {
// Sign-out successful.
console.log("Sign Out Succesful!");
}, function(error) {
// An error happened.
}
);
</script>
</head>
<body>
</body>