Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login fail !!!! #78

Open
dmitryshelomanov opened this issue May 15, 2018 · 6 comments
Open

login fail !!!! #78

dmitryshelomanov opened this issue May 15, 2018 · 6 comments

Comments

@dmitryshelomanov
Copy link

this.login = function (username, password, callback) {
        var self = this;
        this.rocketChatClient.authentication.login(username, password, function (err, body) {
            
            self.token = body.data;
            callback(null, body);
        });
    };

no handle error !!! App crashed

@ShoaibCubix
Copy link

Call it as rocketChatApi.login(username, password, function(err,body){
if(err)
console.log(err);
else
console.log(body);
})

@dmitryshelomanov
Copy link
Author

@ShoaibCubix
this

this.login = function (username, password, callback) {
        var self = this;
        this.rocketChatClient.authentication.login(username, password, function (err, body) {
            
            self.token = body.data;
            callback(null, body);
        });
    };

not my code. Error not handle. When error and body === null -> self.token = body.data (this crash)

@ShoaibCubix
Copy link

Yeah you are right

@dmitryshelomanov
Copy link
Author

@ShoaibCubix you make fix ?

@ShoaibCubix
Copy link

@userbq201 Not yet. Busy with job.

@dmitryshelomanov
Copy link
Author

@ShoaibCubix ok. I opened PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants