Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login(username, password, callback) {
- var myResponse;
- var systemUser;
- Users.getByLogin(username)
- .then(function (response) {
- systemUser = response.data;
- });
- // Linha testada
- console.log("Senha: " + systemUser.password);
- console.log("Senha informada: " + password);
- if (typeof systemUser == "undefined") {
- myResponse = { success: false, message: "Usuário inexistente!" };
- } else if (password == systemUser.password) {
- myResponse = { success: true, user: systemUser };
- } else {
- myResponse = { success: false, message: "Usuário ou senha incorretos!" };
- }
- callback(myResponse);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement