From 6fde3ede7c6e89fdba31b51d97cd99871b46ef78 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 27 Jan 2024 23:51:36 +0100 Subject: [PATCH] Separate AuthRequest and RegistrationRequest --- Iceshrimp.Backend/Controllers/AuthController.cs | 2 +- Iceshrimp.Backend/Controllers/Schemas/AuthRequest.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Iceshrimp.Backend/Controllers/AuthController.cs b/Iceshrimp.Backend/Controllers/AuthController.cs index 1be83cdc..cd8ada80 100644 --- a/Iceshrimp.Backend/Controllers/AuthController.cs +++ b/Iceshrimp.Backend/Controllers/AuthController.cs @@ -69,7 +69,7 @@ public class AuthController(DatabaseContext db, UserService userSvc) : Controlle [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ErrorResponse))] [ProducesResponseType(StatusCodes.Status401Unauthorized, Type = typeof(ErrorResponse))] [ProducesResponseType(StatusCodes.Status403Forbidden, Type = typeof(ErrorResponse))] - public async Task Register([FromBody] AuthRequest request) { + public async Task Register([FromBody] RegistrationRequest request) { //TODO: captcha support //TODO: invite support diff --git a/Iceshrimp.Backend/Controllers/Schemas/AuthRequest.cs b/Iceshrimp.Backend/Controllers/Schemas/AuthRequest.cs index 3b8df4cc..e12549cb 100644 --- a/Iceshrimp.Backend/Controllers/Schemas/AuthRequest.cs +++ b/Iceshrimp.Backend/Controllers/Schemas/AuthRequest.cs @@ -5,5 +5,8 @@ namespace Iceshrimp.Backend.Controllers.Schemas; public class AuthRequest { [J("username")] public required string Username { get; set; } [J("password")] public required string Password { get; set; } +} + +public class RegistrationRequest : AuthRequest { [J("invite")] public string? Invite { get; set; } } \ No newline at end of file