Last active
June 23, 2021 17:17
-
-
Save AsthaSharma1/8e6115083cbe16504bc603e7f88196ce to your computer and use it in GitHub Desktop.
login form javascript code for a tutorial www.apispreadsheets.com/tutorials/custom-web-app-forms-login-update-delete.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your web app's Firebase configuration | |
var firebaseConfig = { | |
apiKey: "AIzaSyBAGCR7VhRhpCTbln069BS4WTFf0UQcbyk", | |
authDomain: "loginpage-dc3a1.firebaseapp.com", | |
projectId: "loginpage-dc3a1", | |
storageBucket: "loginpage-dc3a1.appspot.com", | |
messagingSenderId: "368995587873", | |
appId: "1:368995587873:web:9997247edef5f1b74f9060" | |
}; | |
// Initialize Firebase | |
firebase.initializeApp(firebaseConfig); | |
const auth = firebase.auth(); | |
function signIn(){ | |
var email = document.getElementById("email"); | |
var password = document.getElementById("password"); | |
const promise = auth.signInWithEmailAndPassword(email.value, password.value); | |
promise.then(() => location.replace("./djQueue.html")).catch(e => alert(e.message)); | |
}; | |
function signOut(){ | |
auth.signOut(); | |
location.replace("./login.html"); | |
alert("Signed Out") | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment