refactor: to return the result according to the RFC 7807 standard and add a traceId

This commit is contained in:
2024-12-22 05:25:19 +03:00
parent f2e79e51f2
commit e4b942d062
10 changed files with 68 additions and 74 deletions

View File

@ -30,6 +30,7 @@ using System.IO;
using System.Linq;
using System.Net.Mail;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Cryptography;
using PasswordPolicy = Mirea.Api.Dto.Common.PasswordPolicy;
@ -88,7 +89,7 @@ public class SetupController(
}
if (!setupToken.MatchToken(tokenBase64))
return Unauthorized("The token is not valid");
throw new SecurityException("The token is not valid");
Response.Cookies.Append(TokenAuthenticationAttribute.AuthToken, token, new CookieOptions
{