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

Optional userLogin in getUserPreference API #16010

Merged
merged 3 commits into from Jun 2, 2020
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jun 2, 2020

Needed this for matomo-org/matomo-mobile-2#5406

We're now allowing users to log in using their token auth. This way for example people using

  • LoginLdap
  • Two factor authentication
  • Matomo for WordPress (to be confirmed)

can also use the mobile app. It basically looks like this:

image

Because the user is no longer logging in with username/password, I no longer have a username to pass to the getUserPreference method. We call this API in the mobile app to find out which site to load by default and which date to show by default.

There was no API method to get the userLogin for an auth token. Could have added such an API but that would mean we always have two API calls when instead the method could simply default to the current user log in.

Adding this to 3.X since the same Matomo mobile app will be used for Matomo 3 and Matomo 4 and by making this work in the latest 3.X we will have less issues with users trying to log in using token auth. This way we also don't need to wait for months to release this new update as people will be able to use it right away. (if they use a recent Matomo version)

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

Left a small comment. Otherwise LGTM

CHANGELOG.md Outdated
@@ -4,6 +4,11 @@ This is the Developer Changelog for Matomo platform developers. All changes in o

The Product Changelog at **[matomo.org/changelog](https://matomo.org/changelog)** lets you see more details about any Matomo release, such as the list of new guides and FAQs, security fixes, and links to all closed issues.

## Matomo 3.13.6

### New API
Copy link
Member

Choose a reason for hiding this comment

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

New API doesn't seem to be the best headline here...

Copy link
Member Author

Choose a reason for hiding this comment

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

The others didn't quite work either which is why I used New API.... will add a new category API changes

@tsteur tsteur merged commit fb8a9d2 into 3.x-dev Jun 2, 2020
@tsteur tsteur deleted the optionaluserlogin branch June 2, 2020 20:15
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants