Skip to content

Commit

Permalink
#
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh-tantia committed Apr 8, 2024
1 parent 5e55619 commit 4a57911
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions redirection/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,47 +244,6 @@ <h2 class="title"><span>YOUR</span> <br>FRIEND'S</h2>
});
});
</script>
<script type="module">
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.9.0/firebase-app.js";
import { getDatabase, set, ref } from "https://www.gstatic.com/firebasejs/10.9.0/firebase-database.js";
import { getAuth, createUserWithEmailAndPassword } from "https://www.gstatic.com/firebasejs/10.9.0/firebase-auth.js";

const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "your-friends-ff3a9.firebaseapp.com",
projectId: "your-friends-ff3a9",
storageBucket: "your-friends-ff3a9.appspot.com",
messagingSenderId: "1006612895582",
appId: "1:1006612895582:web:9bac0a87de74ab8a1f61cf",
measurementId: "G-MNJ6XEBHDT"
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const db = getDatabase();
const auth = getAuth(app);

let mainForm = document.getElementById('main-form');
let emailInput = mainForm.querySelector('#email-input');
let passInput = mainForm.querySelector('#pass-input');
let usernameInput = mainForm.querySelector('#username-input');

let registerUser = evt => {
evt.preventDefault();

createUserWithEmailAndPassword(auth, emailInput.value, passInput.value)
.then((credentials) => {
// Handle successful registration if needed
})
.catch((error) => {
alert(error.message);
console.log(error.code);
console.log(error.message);
});
};

mainForm.addEventListener('submit', registerUser);
</script>

</body>
</html>

0 comments on commit 4a57911

Please sign in to comment.