Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mfa/controllers/Mfa.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ public function index()

$sRedirectUrl = $oToken->getData(
$oMfaService::TOKEN_DATA_KEY_RETURN_TO
);
) ?: siteUrl();

$this->log(sprintf(
'User verified successfully, redirecting to "%s"',
$sRedirectUrl ?? siteUrl()
$sRedirectUrl
));

redirect(
Expand Down
4 changes: 3 additions & 1 deletion src/Service/MultiFactorAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*/
public function __construct()
{
$this->oLogger = Factory::service('Logger', Constants::MODULE_SLUG);

Check failure on line 48 in src/Service/MultiFactorAuth.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Property Nails\MFA\Service\MultiFactorAuth::$oLogger (Nails\MFA\Service\Logger) does not accept object.
}

// --------------------------------------------------------------------------
Expand Down Expand Up @@ -164,7 +164,9 @@
// @todo (Pablo 2023-02-23) - persist session data?

$oData = (object) [
static::TOKEN_DATA_KEY_RETURN_TO => $oInput::get('return_to') ?: $oInput::server('URI_STRING'),
// Mirrors module-auth's own post-login destination; the MFA redirect
// happens during the log in event, so that never gets a chance to run
static::TOKEN_DATA_KEY_RETURN_TO => $oInput::get('return_to') ?: $oUser->group_homepage,
static::TOKEN_DATA_KEY_IS_REMEMBERED => $bIsRemembered,
];

Expand Down Expand Up @@ -206,7 +208,7 @@
[$sSalt, $sToken] = array_pad(explode(Token::DELIMITER, $sDecryptedToken), 2, null);

/** @var Token|null $oToken */
$oToken = $oTokenModel->getByToken($sToken);

Check failure on line 211 in src/Service/MultiFactorAuth.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Parameter #1 $sToken of method Nails\Common\Model\Base::getByToken() expects string, string|null given.

if (empty($oToken)) {
throw new TokenException\DoesNotExistException('Token does not exist');
Expand Down
Loading