Skip to content

Commit f91f856

Browse files
committed
user tag instead of adding new augmented data
1 parent 2882082 commit f91f856

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/Auth/AugmentedUser.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ private function commonKeys()
4242
'avatar',
4343
'api_url',
4444
'preferred_locale',
45-
'has_enabled_two_factor_authentication',
4645
];
4746
}
4847

src/Auth/UserTags.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,16 @@ public function eventUrl($url, $relative = false)
796796
);
797797
}
798798

799+
/**
800+
* Output a boolean of whether two-factor auth is enabled for the user.
801+
*
802+
* Maps to {{ user:two_factor_enabled }}
803+
*/
804+
public function twoFactorEnabled(): bool
805+
{
806+
return (bool) User::current()?->hasEnabledTwoFactorAuthentication();
807+
}
808+
799809
/**
800810
* Output a two-factor challenge form for login verification.
801811
*

0 commit comments

Comments
 (0)