fix(TwoFactorAuthenticationEnforceFilter.php): use $user variable instead of accessing Yii::$app->user->identity multiple times for better readability and performance
fix(MailService.php): remove unnecessary whitespace before $this->mailer to improve code formatting
This commit is contained in:
@ -40,7 +40,7 @@ class TwoFactorAuthenticationEnforceFilter extends ActionFilter
|
||||
$permissions = $module->twoFactorAuthenticationForcedPermissions;
|
||||
|
||||
$user = Yii::$app->user->identity;
|
||||
$itemsByUser = array_keys($this->getAuthManager()->getItemsByUser(Yii::$app->user->identity->id));
|
||||
$itemsByUser = array_keys($this->getAuthManager()->getItemsByUser($user->id));
|
||||
if (!empty(array_intersect($permissions, $itemsByUser)) && !$user->auth_tf_enabled) {
|
||||
Yii::$app->session->setFlash('warning', Yii::t('usuario', 'Your role requires 2FA, you won\'t be able to use the application until you enable it'));
|
||||
return Yii::$app->response->redirect(['/user/settings/account'])->send();
|
||||
|
||||
@ -83,7 +83,6 @@ class MailService implements ServiceInterface
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
$result = $this->mailer
|
||||
->compose(['html' => $this->view, 'text' => "text/{$this->view}"], $this->params)
|
||||
->setFrom($this->from)
|
||||
|
||||
Reference in New Issue
Block a user