Skip to content

Instantly share code, notes, and snippets.

@RomikMakavana
Created June 4, 2022 19:05
Show Gist options
  • Save RomikMakavana/efba20df3944080b1868b775c119c629 to your computer and use it in GitHub Desktop.
Save RomikMakavana/efba20df3944080b1868b775c119c629 to your computer and use it in GitHub Desktop.
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