Net_RouterOS icon indicating copy to clipboard operation
Net_RouterOS copied to clipboard

Login doesn't work on 6.43

Open brsnik opened this issue 7 years ago • 3 comments

Hello,

I've upgraded to version 6.43rc5 only to find out the API login doesn't work as they've changed the way you're supposed to login.

Can I please get a quick tip on how to modify it so I can use the latest update?

brsnik avatar Jul 07 '18 12:07 brsnik

I haven't looked at the code yet, but I think the fix should be similar to what I've done in perl's library/ Maybe this will help: https://github.com/martin8883/MikroTik-API/pull/4/files

ArtemKobz avatar Jul 09 '18 20:07 ArtemKobz

#37 Same issue

sieberlukas avatar Jul 30 '18 09:07 sieberlukas

I have a solution to resolve this problem: Change function to the new code in Client.php file below:

private static function _login(
        Communicator $com,
        $username,
        $password = '',
        $timeout = null
    ) {
        $request = new Request('/login');
        $request->setArgument('name', $username);
        $request->setArgument('password', $password);
        $request->send($com);
        $response = new Response($com, false, $timeout);
        return $response->getType() === Response::TYPE_FINAL;
    }

suminhthanh avatar Jul 24 '19 08:07 suminhthanh