diff --git a/src/MediawikiApi.php b/src/MediawikiApi.php index c5cf9f0..c571046 100644 --- a/src/MediawikiApi.php +++ b/src/MediawikiApi.php @@ -108,9 +108,9 @@ public function login( ApiUser $apiUser ) { 'lgname' => $apiUser->getUsername(), 'lgpassword' => $apiUser->getPassword() ); - $result = $this->postAction( 'login', $credentials, $apiUser ); + $result = $this->postAction( 'login', $credentials ); if ( $result['login']['result'] == "NeedToken" ) { - $result = $this->postAction( 'login', array_merge( array( 'lgtoken' => $result['login']['token'] ), $credentials), $apiUser ); + $result = $this->postAction( 'login', array_merge( array( 'lgtoken' => $result['login']['token'] ), $credentials) ); } if ( $result['login']['result'] == "Success" ) { $this->isLoggedIn = $apiUser->getUsername();