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

In Overlay do not call API directly since it does not have access to the token auth. #13420

Closed
wants to merge 2 commits into from

Conversation

diosmosis
Copy link
Member

Fixes #13406

Authenticating via UI session in API requests is no longer supported.

@diosmosis diosmosis added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Sep 13, 2018
@diosmosis diosmosis added this to the 3.6.1 milestone Sep 13, 2018

private function apiRequest($methodName)
{
$_GET['method'] = $_POST['method'] = 'Overlay.' . $methodName;
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to use Request::processRequest instead of dispatching new request fully?

Copy link
Member Author

@diosmosis diosmosis Sep 13, 2018

Choose a reason for hiding this comment

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

I could use new Request(...) (processRequest hard codes some params).

Note: the index() API controller action does some extra stuff, not sure if it will be important to replicate that logic here (now or in the future if anything else is added there).

Copy link
Member

Choose a reason for hiding this comment

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

I see... new Request should work then. Don't think we need to apply filter limit I suppose from API index.

In Tag Manager we simply set the format directly as we needed it for example in JSON: https://github.com/matomo-org/tag-manager/blob/master/Controller.php#L172-L173
but new Request or Request::... should work 👍

@diosmosis
Copy link
Member Author

Updated.

@diosmosis
Copy link
Member Author

Closing in favor of #13446

@diosmosis diosmosis closed this Sep 18, 2018
@diosmosis diosmosis deleted the 13406-overlay-api branch September 18, 2018 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants