-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
45 lines (31 loc) · 1.25 KB
/
app.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var config = {
apiKey: "AIzaSyA9dfs_lR82kfVivTLqQf2mhZdnvjxf7lE",
authDomain: "dua-app-cfc35.firebaseapp.com",
databaseURL: "https://dua-app-cfc35.firebaseio.com",
};
firebase.initializeApp(config);
var emailInput=document.getElementById('getemail');
var passInput=document.getElementById('getpass');
database=firebase.database().ref('/');
auth=firebase.auth();
database=firebase.database().ref('/');
function signin(){
var user={
email:emailInput.value,
password:passInput.value
};
auth.signInWithEmailAndPassword(user.email,user.password).catch(function(error){
document.getElementById('Error').innerHTML=" <div class='alert alert-success Profile' role='alert'> <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span> </button> <h4 class='alert-heading'>Error</h4> <hr> <p class='mb-0'>"+error.message+ '</p></div>' ;
}).then(function(usr){
emailInput.value='';
passInput.value='';
localStorage.setItem('CurentUser',usr.uid);
location='Home.html';
});}
// database.child('Users').on('value',function (snap){
// var allusers=snap.val();
// console.log();
// });
function sigup(){
location='signup.html';
}