Skip to content

Commit

Permalink
Merge pull request #19 from gear4dave/fix/authentication
Browse files Browse the repository at this point in the history
Authentication fixes
  • Loading branch information
DaveWilcock authored May 12, 2017
2 parents fca050a + ce0f3b0 commit 70905a4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/dawguk/GarminConnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,8 @@ private function authorize($strUsername, $strPassword)
"displayNameRequired" => "false"
);

preg_match("/name=\"lt\"\s+value=\"([^\"]+)\"/", $strResponse, $arrMatches);
if (!isset($arrMatches[1])) {
throw new AuthenticationException("\"lt\" value wasn't found in response");
}

$arrData['lt'] = $arrMatches[1];

$strResponse = $this->objConnector->post("https://sso.garmin.com/sso/login", $arrParams, $arrData, false);
preg_match("/ticket=([^']+)'/", $strResponse, $arrMatches);
preg_match("/ticket=([^\"]+)\"/", $strResponse, $arrMatches);

if (!isset($arrMatches[1])) {

Expand Down

0 comments on commit 70905a4

Please sign in to comment.