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
[5.2] Fixing timezone and language parameter in API token auth response #43351
base: 5.2-dev
Are you sure you want to change the base?
Conversation
@brianteeman what's the issue? |
Missing documentation |
What documentation are you expecting? |
@@ -247,8 +247,8 @@ public function onUserAuthenticate(AuthenticationEvent $event): void | |||
$response->username = $user->username; | |||
$response->email = $user->email; | |||
$response->fullname = $user->name; | |||
$response->timezone = $user->get('timezone'); | |||
$response->language = $user->get('language'); | |||
$response->timezone = $user->getParam('timezone', $this->getApplication()->get('offset', 'GMT')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it not be UTC instead of GMT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use both UTC and GMT. In com_users MethodsModel and in libraries FeedDocument we use UTC and in the user class we use GMT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the global Joomla configuration we use UTC, so I would stick to it. But it is a minor issue.
Summary of Changes
In the token API authentication plugin we are constructing a response with the timezone and language from the user object. However, that data is stored in the params and to get that, you have to call getParam() and not just get(). The later is the ->get from CMSObject and doesn't return anything in this instance.
Testing Instructions
Codereview
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed