diff --git a/Fin-Backend.sln.DotSettings.user b/Fin-Backend.sln.DotSettings.user
index 0a010a0..18eaaeb 100644
--- a/Fin-Backend.sln.DotSettings.user
+++ b/Fin-Backend.sln.DotSettings.user
@@ -9,15 +9,22 @@
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
- <SessionState ContinuousTestingMode="0" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
+ <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
<Solution />
</SessionState>
- <SessionState ContinuousTestingMode="0" IsActive="True" Name="MailSenderClientTest" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
+ <SessionState ContinuousTestingMode="0" Name="MailSenderClientTest" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
<Project Location="/home/rafaelchicovis/git/fin-backend/Fin.Test" Presentation="<Fin.Test>" />
</SessionState>
+ True
+ False
+ True
+ False
+ True
+ True
diff --git a/Fin.Api/Fin.Api.csproj b/Fin.Api/Fin.Api.csproj
index 4f9c60c..cd13eaa 100644
--- a/Fin.Api/Fin.Api.csproj
+++ b/Fin.Api/Fin.Api.csproj
@@ -1,10 +1,11 @@
-
+
net9.0
enable
+ en
-
+
diff --git a/Fin.Api/Tenants/TenantController.cs b/Fin.Api/Tenants/TenantController.cs
new file mode 100644
index 0000000..705eb6d
--- /dev/null
+++ b/Fin.Api/Tenants/TenantController.cs
@@ -0,0 +1,18 @@
+using Fin.Application.Tenants;
+using Fin.Application.Tenants.Dtos;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Fin.Api.Tenants;
+
+[Route("tenants")]
+[Authorize]
+public class TenantController(ITenantService service): ControllerBase
+{
+ [HttpGet("{id:guid}")]
+ public async Task> Get([FromRoute] Guid id)
+ {
+ var menu = await service.Get(id);
+ return menu != null ? Ok(menu) : NotFound();
+ }
+}
\ No newline at end of file
diff --git a/Fin.Application/Authentications/Services/AuthenticationService.cs b/Fin.Application/Authentications/Services/AuthenticationService.cs
index a056f6f..54e7766 100644
--- a/Fin.Application/Authentications/Services/AuthenticationService.cs
+++ b/Fin.Application/Authentications/Services/AuthenticationService.cs
@@ -1,10 +1,9 @@
using Fin.Application.Authentications.Dtos;
using Fin.Application.Authentications.Enums;
-using Fin.Application.Authentications.Utils;
+using Fin.Application.Emails;
using Fin.Application.Globals.Dtos;
using Fin.Application.Users.Services;
using Fin.Domain.Global;
-using Fin.Domain.Tenants.Entities;
using Fin.Domain.Users.Dtos;
using Fin.Domain.Users.Entities;
using Fin.Infrastructure.Authentications;
@@ -14,7 +13,6 @@
using Fin.Infrastructure.AutoServices.Interfaces;
using Fin.Infrastructure.Constants;
using Fin.Infrastructure.Database.Repositories;
-using Fin.Infrastructure.EmailSenders;
using Fin.Infrastructure.EmailSenders.Dto;
using Fin.Infrastructure.Redis;
using Microsoft.EntityFrameworkCore;
@@ -59,6 +57,7 @@ public AuthenticationService(
_configuration = configuration;
_tokenService = tokenService;
_userCreateService = userCreateService;
+
var encryptKey = configuration.GetSection(AuthenticationConstants.EncryptKeyConfigKey).Value ?? "";
var encryptIv = configuration.GetSection(AuthenticationConstants.EncryptIvConfigKey).Value ?? "";
@@ -90,26 +89,17 @@ public async Task SendResetPasswordEmail(SendResetPasswordEmailInput input)
var logoIconUrl = $"{frontUrl}/icons/fin.png";
var resetLink = $"{frontUrl}/authentication/reset-password?token={token}";
- var subject = AuthenticationTemplates.ResetPasswordEmailSubject
- .Replace("{{appName}}", AppConstants.AppName);
-
- var plainBody = AuthenticationTemplates.ResetPasswordEmailPlainTemplate
- .Replace("{{appName}}", AppConstants.AppName)
- .Replace("{{linkLifeTime}}", tokenLifeTimeInHours.ToString())
- .Replace("{{resetLink}}", resetLink);
+ var parameters = new Dictionary();
+ parameters.Add("appName", AppConstants.AppName);
+ parameters.Add("linkLifeTime", tokenLifeTimeInHours.ToString());
+ parameters.Add("resetLink", resetLink);
+ parameters.Add("logoIconUrl", logoIconUrl);
- var htmlBody = AuthenticationTemplates.ResetPasswordEmailTemplate
- .Replace("{{appName}}", AppConstants.AppName)
- .Replace("{{logoIconUrl}}", logoIconUrl)
- .Replace("{{linkLifeTime}}", tokenLifeTimeInHours.ToString())
- .Replace("{{resetLink}}", resetLink);
-
await _emailSender.SendEmailAsync(new SendEmailDto
{
- Subject = subject,
+ BaseTemplatesName = "ResetPassword_",
+ TemplateProperties = parameters,
ToEmail = input.Email,
- PlainBody = plainBody,
- HtmlBody = htmlBody,
ToName = credential.User.DisplayName
});
}
diff --git a/Fin.Application/Authentications/Utils/AuthenticationTemplates.cs b/Fin.Application/Authentications/Utils/AuthenticationTemplates.cs
index c67ce2d..c2e55cc 100644
--- a/Fin.Application/Authentications/Utils/AuthenticationTemplates.cs
+++ b/Fin.Application/Authentications/Utils/AuthenticationTemplates.cs
@@ -109,160 +109,5 @@ public static class AuthenticationTemplates