Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Fixed the receive code page #112

Closed
wants to merge 2 commits into from
Closed

Conversation

ezimuel
Copy link
Contributor

@ezimuel ezimuel commented Jul 20, 2015

This PR fixes the issue #111

if ($this->code) {
printf("<h2>The authentication code is %s</h2>", $this->code);
printf("<p>Use this code to request an access token.</p>");
printf("For instance, using <a href=\"https://github.com/jkbr/httpie\">HTTPie</a>:</p> ");
printf(
"<p>http POST https://%s/oauth grant_type=authorization_code code=%s redirect_uri=%s client_id=testclient client_secret=testpass</p>",
"<p>http POST %s://%s/oauth grant_type=authorization_code code=%s redirect_uri=%s client_id=testclient client_secret=testpass</p>",
$http,
$_SERVER['HTTP_HOST'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking that this should be:

"<p>http POST %s grant_type=authorization_code code=%s redirect_uri=%s client_id=testclient client_secret=testpass</p>",
$this->serverUrl('/oauth'),
$this->code,
'/oauth/receivecode'

The serverUrl() view helper will properly determine the scheme and authority, and if you pass a path, it will use that path to generate the fully qualified URI with scheme and authority.

Please do that throughout this patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weierophinney ok, changed. Thanks!

@nuxwin
Copy link

nuxwin commented Jul 20, 2015

@ezimuel Why you escape quotes instead of just removing them (for the parsing error)? See my duplicate PR #113

@ezimuel
Copy link
Contributor Author

ezimuel commented Jul 21, 2015

@nuxwin because it's required by curl, I just tested.

@weierophinney weierophinney added this to the 1.3.1 milestone Jul 23, 2015
@weierophinney weierophinney self-assigned this Jul 23, 2015
weierophinney added a commit that referenced this pull request Jul 23, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants