mikronode wrong password check

Hello ,
I have a running mikronode app that connect to my router and get data - works like a charm!

but sometime I check devices that have another password
what do I need to do in the code in order to see I’m sending the wrong password , and then enter new one?

if I use the example :

var MikroNode = require('mikronode');

    var device = new MikroNode('192.168.0.1');
    device.connect()
      .then(([login])=>{
        return login('username','password');
        //this is what I was thinking about but it's not working..... I guess I miss something :-) 
        then([error])  what do I need to write here in order to enter 
         return login('username2','password2');
      })
      .then(function(conn) {