feat(backend): move internal endpoints to /api/internal

This commit is contained in:
sam 2024-10-02 00:15:14 +02:00
parent eac0a17473
commit 06f7019330
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
9 changed files with 39 additions and 27 deletions

View file

@ -1,6 +1,7 @@
using Foxnouns.Backend.Database;
using Foxnouns.Backend.Database.Models;
using Foxnouns.Backend.Extensions;
using Foxnouns.Backend.Middleware;
using Foxnouns.Backend.Services;
using Foxnouns.Backend.Utils;
using JetBrains.Annotations;
@ -10,7 +11,7 @@ using NodaTime;
namespace Foxnouns.Backend.Controllers.Authentication;
[Route("/api/v2/auth/email")]
[Route("/api/internal/auth/email")]
public class EmailAuthController(
[UsedImplicitly] Config config,
DatabaseContext db,
@ -123,6 +124,17 @@ public class EmailAuthController(
));
}
[HttpPost("add")]
[Authorize("*")]
public async Task<IActionResult> AddEmailAddressAsync()
{
_logger.Information("beep");
return NoContent();
}
public record AddEmailAddressRequest(string Email, string Password);
private void CheckRequirements()
{
if (!config.EmailAuth.Enabled)