mirror of
https://github.com/claunia/marechai.git
synced 2026-07-08 17:57:08 +00:00
- Added two-factor authentication support in the login process, including handling for two-factor tokens and available methods. - Enhanced the login page to manage two-factor verification and recovery codes. - Introduced a security tab in the user profile for managing two-factor authentication settings, including enabling/disabling authenticator and email methods. - Implemented backend services for managing two-factor authentication, including enabling/disabling methods and regenerating recovery codes. - Added admin functionality to disable two-factor authentication for users. - Updated UI components to reflect changes in two-factor authentication status and provide user feedback. - Configured SMTP settings for email notifications related to two-factor authentication.
23 lines
870 B
C#
23 lines
870 B
C#
using RazorLight;
|
|
|
|
namespace Marechai.Email;
|
|
|
|
/// <summary>
|
|
/// <see cref="IEmailTemplateRenderer" /> implementation backed by RazorLight, with templates loaded as
|
|
/// embedded resources from this assembly. Caches a single <see cref="RazorLightEngine" /> for the lifetime of
|
|
/// the process.
|
|
/// </summary>
|
|
public sealed class RazorLightEmailTemplateRenderer : IEmailTemplateRenderer
|
|
{
|
|
readonly RazorLightEngine _engine;
|
|
|
|
public RazorLightEmailTemplateRenderer() =>
|
|
_engine = new RazorLightEngineBuilder()
|
|
.UseEmbeddedResourcesProject(typeof(RazorLightEmailTemplateRenderer).Assembly, "Marechai.Email.Templates")
|
|
.UseMemoryCachingProvider()
|
|
.Build();
|
|
|
|
public Task<string> RenderAsync<TModel>(string templateKey, TModel model) =>
|
|
_engine.CompileRenderAsync(templateKey, model);
|
|
}
|