Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- register() {
- var email = '';
- var password = '';
- this.firebase.auth().createUserWithEmailAndPassword(email, password)
- .then(function (response) {
- // successful register
- })
- .catch(function (e) {
- // register failure
- })
- }
- /***************************************************************/
- login() {
- var email = '';
- var password = '';
- this.firebase.auth().signInWithEmailAndPassword(email, password)
- .then(function (response) {
- // success
- })
- .catch(function () {
- // failure
- });
- }
- /***************************************************************/
- // get current auth user
- var user = firebase.auth().currentUser;
- if (user) {
- // User is signed in.
- } else {
- // No user is signed in.
- }
Add Comment
Please, Sign In to add comment