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 doesn't work on 6.43 #39

Open
brsnik opened this issue Jul 7, 2018 · 3 comments
Open

Login doesn't work on 6.43 #39

brsnik opened this issue Jul 7, 2018 · 3 comments

Comments

@brsnik
Copy link

brsnik commented Jul 7, 2018

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?

@ArtemKobz
Copy link

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

@sieberlukas
Copy link

#37 Same issue

@suminhthanh
Copy link

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;
    }

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

4 participants