Skip to content

Commit

Permalink
Merge branch '6.0' into 6
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 20, 2025
2 parents d1866f9 + 3f9b6f2 commit ba8f1d4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 2 additions & 0 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ default:
- SilverStripe\Framework\Tests\Behaviour\CmsUiContext
- SilverStripe\BehatExtension\Context\BasicContext
- SilverStripe\BehatExtension\Context\EmailContext
- SilverStripe\BehatExtension\Context\FixtureContext:
- '%paths.modules.mfa%/tests/Behat/features/files/'
- SilverStripe\MFA\Tests\Behat\Context\LoginContext
- SilverStripe\CMS\Tests\Behaviour\ThemeContext
extensions:
Expand Down
2 changes: 1 addition & 1 deletion client/dist/js/bundle-cms.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions client/src/boot/cms/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* global window */
import registerComponents from './registerComponents';
import registerReducers from './registerReducers';
import registerTransformations from './registerTransformations';

window.document.addEventListener('DOMContentLoaded', () => {
registerComponents();
registerReducers();
registerTransformations();
});
9 changes: 0 additions & 9 deletions client/src/boot/cms/registerTransformations.js

This file was deleted.

8 changes: 8 additions & 0 deletions src/Authenticator/LoginHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use SilverStripe\Security\MemberAuthenticator\LoginHandler as BaseLoginHandler;
use SilverStripe\Security\MemberAuthenticator\MemberLoginForm;
use SilverStripe\Security\Security;
use SilverStripe\Core\ClassInfo;

class LoginHandler extends BaseLoginHandler
{
Expand Down Expand Up @@ -576,6 +577,13 @@ public function jsonResponse(array $response, int $code = 200): HTTPResponse
*/
protected function doPerformLogin(HTTPRequest $request, Member $member)
{
// Deactivate sudo mode that was activated in doLogin()
$service = $this->getSudoModeService();
// Check if the service has a deactivate method, because it is not defined on the interface
if (ClassInfo::hasMethod($service, 'deactivate')) {
call_user_func([$service, 'deactivate'], $this->getRequest()->getSession());
}

// Load the previously stored data from session and perform the login using it...
$data = $request->getSession()->get(static::SESSION_KEY . '.additionalData') ?: [];

Expand Down
6 changes: 3 additions & 3 deletions src/Extension/MemberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ public function providePermissions(): array
*/
protected function onAfterMemberLoggedIn(): void
{
if (!Controller::has_curr()) {
$controller = Controller::curr();
if (!$controller) {
return;
}

Controller::curr()
$controller
->getRequest()
->getSession()
->clear(ChangePasswordHandler::MFA_VERIFIED_ON_CHANGE_PASSWORD);
Expand Down
Empty file.
3 changes: 2 additions & 1 deletion tests/Behat/features/mfa-enabled.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Feature: MFA is enabled for the site
So that my site will be more secure

Background:
Given I am logged in with "ADMIN" permissions
Given I add an extension "SilverStripe\BehatExtension\Extensions\ActivateSudoModeServiceExtension" to the "SilverStripe\Security\SudoMode\SudoModeService" class
And I am logged in with "ADMIN" permissions
And I go to "/admin"
Then I should see the CMS

Expand Down

0 comments on commit ba8f1d4

Please sign in to comment.