-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.js
59 lines (43 loc) · 1.79 KB
/
signup.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
52
53
54
55
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.17.1/firebase-app.js";
import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.17.1/firebase-analytics.js";
import { getAuth, createUserWithEmailAndPassword, signInWithEmailAndPassword, onAuthStateChanged, signOut } from "https://www.gstatic.com/firebasejs/9.17.1/firebase-auth.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyD8p2wy9ftIXyYE_vj2xYKdkqQBc3K8e_I",
authDomain: "wolftube-6e83a.firebaseapp.com",
databaseURL: "https://wolftube-6e83a-default-rtdb.firebaseio.com",
projectId: "wolftube-6e83a",
storageBucket: "wolftube-6e83a.appspot.com",
messagingSenderId: "352393340794",
appId: "1:352393340794:web:9b9822a09c6667cc4a98c3",
measurementId: "G-X1W8K649YJ"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
// get email and passowrd.
const auth = getAuth(app);
function DarkWolfieTube() {
var email = document.getElementById('email').value
var password = document.getElementById("pass").value
createUserWithEmailAndPassword(auth, email, password)
.then((userCredential) => {
// Signed in
const user = userCredential.user.uid;
window.location.assign("../login/auth?user=" + user)
// ...
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
// ..
});
}
document.getElementById("submit").addEventListener("click",(e) =>{
DarkWolfieTube()
}
)