set two-factor auth enabled date
This commit is contained in:
@@ -76,6 +76,11 @@ public abstract class ZeroIdentityUser : ZeroEntity
|
||||
/// </summary>
|
||||
public bool TwoFactorEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When the user activated two-factor authentication
|
||||
/// </summary>
|
||||
public DateTimeOffset? TwoFactorEnabledDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The two-factor authenticator key
|
||||
/// </summary>
|
||||
|
||||
@@ -480,6 +480,7 @@ public partial class ZeroUserStore<TUser> :
|
||||
public Task SetTwoFactorEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken)
|
||||
{
|
||||
user.TwoFactorEnabled = enabled;
|
||||
user.TwoFactorEnabledDate = enabled ? DateTimeOffset.Now : null;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ public class ActiveTagHelper : TagHelper
|
||||
[HtmlAttributeName("href")]
|
||||
public string Href { get; set; }
|
||||
|
||||
public override int Order => 100;
|
||||
|
||||
|
||||
public ActiveTagHelper(IHttpContextAccessor contextAccessor)
|
||||
{
|
||||
@@ -36,7 +38,6 @@ public class ActiveTagHelper : TagHelper
|
||||
classes.Add("is-active-exact");
|
||||
}
|
||||
|
||||
output.Attributes.SetAttribute("href", Href);
|
||||
output.Attributes.SetAttribute("class", string.Join(" ", classes));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user