Merge pull request #4948 from zyhfish/task/fix-4947
Fix #4947: check the 2FA settings.
This commit is contained in:
commit
d19d7d2a43
|
@ -512,7 +512,10 @@ namespace Oqtane.Managers
|
||||||
user = _users.GetUser(user.Username);
|
user = _users.GetUser(user.Username);
|
||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
if (user.TwoFactorRequired && user.TwoFactorCode == token && DateTime.UtcNow < user.TwoFactorExpiry)
|
var alias = _tenantManager.GetAlias();
|
||||||
|
var twoFactorSetting = _settings.GetSetting(EntityNames.Site, alias.SiteId, "LoginOptions:TwoFactor")?.SettingValue ?? "false";
|
||||||
|
var twoFactorRequired = twoFactorSetting == "required" || user.TwoFactorRequired;
|
||||||
|
if (twoFactorRequired && user.TwoFactorCode == token && DateTime.UtcNow < user.TwoFactorExpiry)
|
||||||
{
|
{
|
||||||
user.IsAuthenticated = true;
|
user.IsAuthenticated = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user