Example #1
0
 public function user($username, $response)
 {
     if ($response['code'] === 200) {
         $this->response_body = $response['body'];
     } else {
         return Error::invalid_credentials($username . ' with password [FILTERED]');
     }
 }
Example #2
0
 public function authenticate($username, $password)
 {
     $response = $this->apollo->access_token($username, $password);
     if (is_wp_error($response)) {
         return Error::cannot_connect_to_auth_server();
     } else {
         $login = new Login();
         return $login->user($username, $response);
     }
 }