[4.0] Redirect to com_admin when forcing TFA#30152
[4.0] Redirect to com_admin when forcing TFA#30152wilsonge merged 6 commits intojoomla:4.0-devfrom SharkyKZ:j4/fix/twofactor-redirect
Conversation
|
Just a short note for the testing instructions: Might be worth to mention there that one needs to enable one of the TFA plugins in order to run into this situation. ;-) |
|
Manager Level, before Patch, I got: Then I can't close/leave the session. Had to clear Browser Cache to be able to start again with /administrator entry. |
|
@Harmageddon Thanks, test instructions updated. @le-jou @ChristineWk please test again. |
|
I have tested this item ✅ successfully on ba7c763 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30152. |
|
That's not intended. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
|
I have tested this item ✅ successfully on ba7c763 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30152. |
|
PR updated. Please test again. |
|
I have tested this item ✅ successfully on 30103dd This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30152. |
|
This PR does solve the bug. But I'm not sure whether it is the best solution. Is there any particular reason why the In my tests, reducing the public function save($data)
{
$user = Factory::getUser();
$pk = $user->id;
$data['id'] = $pk;
$data['block'] = $user->block;
return parent::save($data);
}Or am I missing something? What do you think about it? |
|
I have tested this item ✅ successfully on 30103dd This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30152. |
|
@Harmageddon I tried not to touch existing logic. With your code I get this when using super user account:
|
|
@SharkyKZ Oh, I see. Okay, best then to proceed merging this PR here as-is, to fix the described bug. I'm going to write a new PR for the reduction of duplicated code, so we can test it more in detail there. |
|
I have tested this item ✅ successfully on 30103dd This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30152. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30152. |
|
Thanks! |
Fixes #30147.
Summary of Changes
Redirect to
com_admininstead ofcom_userswhen forced TFA is enabled in backend.Testing Instructions
Enable some
Two Factor Authenticationplugins.Enable "Enforce Two Factor Authentication" for Backend
Create a new user with Access Level "Manager"
Login to backend with new user, setup two factor authentication
Actual result BEFORE applying this Pull Request
Message: "You don't have permission to access this. Please contact a website administrator if this is incorrect."
Expected result AFTER applying this Pull Request
Get redirected to user profile page where TFA can be set up properly.
Documentation Changes Required
No.