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

Visitor Profile Popup doesn't include token_auth in the widgetized link #16321

Open
dcoder2099 opened this issue Aug 19, 2020 · 3 comments
Open
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users.

Comments

@dcoder2099
Copy link

Expected Behavior:

Clicking on the visitor id of the Visitor Profile Popup should open the Visitor Profile in a separate window, when the Visitor Profile Popup is rendered as a widget that includes a token_auth query string parameter.

Actual Behavior:

Cicking on the visitor id of the Visitor Profile Popup opens the Sign In screen in a separate window and there is no token_auth in the query string.

Details:

I am embedding the visit log as a widget in an external site that uses token_auth to render the widget in an embedded iframe.

The widget renders fine.

If you click the "View visitor profile" link on any of the visits, the Visitor Profile Popup renders fine.

On the Visitor Profile Popup, if you click on the visitor id, the target of that anchor tag is "_blank" and that opens to the sign-in screen, as the token_auth is not included in the link. If the token_auth is manually added to that link, the profile renders as expected.

The link in plugins/Live/templates/getVisitorProfilePopup.twig is built in .../Live/Controller.php in the setWidgetizedVisitorProfileUrl($view) function. It does not include the token_auth parameter that is included in the iframe's src url.

That's as far as I've gotten as I'm not very familiar with php and twig.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Aug 19, 2020
@tsteur tsteur added this to the Priority Backlog (Help wanted) milestone Aug 19, 2020
@tsteur
Copy link
Member

tsteur commented Aug 19, 2020

Thanks for creating the issue @dcoder2099 It should indeed forward the set token so the link actually works.

internal note: might need to see if we can find a general solution for this maybe even? Although might be hard... just in case we have this problem also in other widgets.

@dcoder2099
Copy link
Author

just in case we have this problem also in other widgets.

FWIW, I ran into a similar problem with the commercial "Heatmaps and Session Recordings" plugin and submitted a patch to Innocraft, which they merged into the plugin (not sure if they cleaned it up or not).

So, it's definitely a "this can happen in other plugins" (FOSS or commercial).

I was actually expecting that Url::getCurrentQueryString() should include the token_auth parameter that is in my iframe/widget url, but I guess that gets chopped out by the authentication subsystem (that's totally a guess; I haven't gotten my local environment rigged up to do anything more than browse the source, let alone attempt to run it).

@tsteur
Copy link
Member

tsteur commented Aug 19, 2020

@tsteur tsteur added Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. and removed Bug For errors / faults / flaws / inconsistencies etc. labels Aug 19, 2020
@mattab mattab added c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Bug For errors / faults / flaws / inconsistencies etc. labels Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users.
Projects
None yet
Development

No branches or pull requests

3 participants