This repository has been archived by the owner on Mar 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextraimp.txt
46 lines (36 loc) · 1.45 KB
/
extraimp.txt
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
function signUp(){
var email = document.getElementById("email");
var password = document.getElementById("password");
const promise = auth.createUserWithEmailAndPassword(email.value, password.value);
promise.catch(e => alert(e.message));
}
function signIn(){
var email = document.getElementById("email");
var password = document.getElementById("password");
const promise = auth.signInWithEmailAndPassword(email.value, password.value);
promise.catch(e => alert(e.message));
}
document.getElementById('userdetails').style.display = 'block';
document.getElementById('googlesign').style.display="none";
document.getElementById('googlesignout').style.display="block";
document.getElementById('userdetails').style.display = 'none';
document.getElementById('googlesign').style.display="block";
document.getElementById('googlesignout').style.display="none";
googleSignIn=()=>{
base_provider = new firebase.auth.GoogleAuthProvider()
firebase.auth().signInWithPopup(base_provider).then(function(result){
console.log(result)
console.log('sign btn clicked');
document.getElementById('userdetails').styel.display = 'block';
}).catch(function(err){
console.log(err)
})
}
googleSignOut=()=>{
firebase.auth().signOut().then(()=>{
document.getElementById('googlesign').style.display="block";
document.getElementById('googlesignout').style.display="none";
}).catch(e=>{
console.log(e)
})
}