Needed this for https://github.com/matomo-org/matomo-mobile-2/pull/5406
We're now allowing users to log in using their token auth. This way for example people using
can also use the mobile app. It basically looks like this:
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)