-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.js
51 lines (42 loc) · 1.35 KB
/
common.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
46
47
48
49
50
51
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.0.2/firebase-app.js";
import { getAuth,
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
signOut
} from "https://www.gstatic.com/firebasejs/9.0.2/firebase-auth.js";
const firebaseConfig = {
apiKey: "AIzaSyBiWeNJ1Vm5JrhgJe6uM2EyyxD5O7EDPWU",
authDomain: "wigi-788bf.firebaseapp.com",
projectId: "wigi-788bf",
storageBucket: "wigi-788bf.appspot.com",
messagingSenderId: "776203766072",
appId: "1:776203766072:web:7ef8a0d2652b293db859cd"
};
// Initialize Firebase
initializeApp(firebaseConfig);
export class ManageAccount{
register (email ,password){
createUserWithEmailAndPassword(getAuth(),email ,password)
.then((_)=>{
window.location.href ="tareas.html";
}).catch((error)=>{
console.error(error.message)
});
}
authenticate(email,password ){
signInWithEmailAndPassword(getAuth(),email ,password)
.then((_)=>{
window.location.href = "tareas.html";
}).catch((error)=>{
console.error(error.message)
});
}
singnOut(){
signOut(getAuth())
.then((_)=>{
window.location.href = "index.html";
}).catch((error)=>{
console.error(error.message)
});
}
}