Created
June 4, 2022 19:05
-
-
Save RomikMakavana/efba20df3944080b1868b775c119c629 to your computer and use it in GitHub Desktop.
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
AuthService.login = (email, password) => { | |
const fauth = getAuth(); | |
return new Promise((resolve, reject) => { | |
signInWithEmailAndPassword(fauth, email, password).then((user) => { | |
if (user) { | |
resolve({ status: true, message: "Login successfully." }); | |
} else { | |
resolve({ status: false, message: "Incorrect Email or Password." }); | |
} | |
}).catch(err => { | |
resolve({ status: false, message: "Incorrect Email or Password." }); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment