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

[5.2] Fixing timezone and language parameter in API token auth response #43351

Open
wants to merge 2 commits into
base: 5.2-dev
Choose a base branch
from

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Apr 24, 2024

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

@HLeithner
Copy link
Member

@brianteeman what's the issue?

@brianteeman
Copy link
Contributor

Missing documentation

@Hackwar
Copy link
Member Author

Hackwar commented May 2, 2024

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'));
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants