|
1 | | -<?php declare(strict_types=1); |
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
2 | 4 |
|
3 | 5 | namespace SilverStripe\MFA\Authenticator; |
4 | 6 |
|
@@ -188,7 +190,8 @@ public function startRegistration(HTTPRequest $request): HTTPResponse |
188 | 190 | $sessionMember = $store ? $store->getMember() : null; |
189 | 191 | $loggedInMember = Security::getCurrentUser(); |
190 | 192 |
|
191 | | - if (($loggedInMember === null && $sessionMember === null) |
| 193 | + if ( |
| 194 | + ($loggedInMember === null && $sessionMember === null) |
192 | 195 | || !$this->getSudoModeService()->check($request->getSession()) |
193 | 196 | ) { |
194 | 197 | return $this->jsonResponse( |
@@ -251,7 +254,8 @@ public function finishRegistration(HTTPRequest $request): HTTPResponse |
251 | 254 | $sessionMember = $store ? $store->getMember() : null; |
252 | 255 | $loggedInMember = Security::getCurrentUser(); |
253 | 256 |
|
254 | | - if (($loggedInMember === null && $sessionMember === null) |
| 257 | + if ( |
| 258 | + ($loggedInMember === null && $sessionMember === null) |
255 | 259 | || !$this->getSudoModeService()->check($request->getSession()) |
256 | 260 | ) { |
257 | 261 | return $this->jsonResponse( |
@@ -284,7 +288,8 @@ public function finishRegistration(HTTPRequest $request): HTTPResponse |
284 | 288 | // required to log in though. The "mustLogin" flag is set at the beginning of the MFA process if they have at |
285 | 289 | // least one method registered. They should always do that first. In that case we should assert |
286 | 290 | // "isLoginComplete" |
287 | | - if ((!$mustLogin || $this->isVerificationComplete($store)) |
| 291 | + if ( |
| 292 | + (!$mustLogin || $this->isVerificationComplete($store)) |
288 | 293 | && $enforcementManager->hasCompletedRegistration($sessionMember) |
289 | 294 | ) { |
290 | 295 | $this->doPerformLogin($request, $sessionMember); |
@@ -447,7 +452,8 @@ public function redirectAfterSuccessfulLogin(): HTTPResponse |
447 | 452 | // This is potentially redundant logic as the member should only be logged in if they've fully registered. |
448 | 453 | // They're allowed to login if they can skip - so only do assertions if they're not allowed to skip |
449 | 454 | // We'll also check that they've registered the required MFA details |
450 | | - if (!$enforcementManager->canSkipMFA($member) |
| 455 | + if ( |
| 456 | + !$enforcementManager->canSkipMFA($member) |
451 | 457 | && !$enforcementManager->hasCompletedRegistration($member) |
452 | 458 | ) { |
453 | 459 | // Log them out again |
|
0 commit comments