hopefully not a horribly foolish refactoring
This commit is contained in:
parent
59d660165f
commit
1ecaf64dea
82 changed files with 782 additions and 398 deletions
27
Femto.Api/Controllers/Auth/AuthController.cs
Normal file
27
Femto.Api/Controllers/Auth/AuthController.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Femto.Api.Controllers.Auth;
|
||||
|
||||
[ApiController]
|
||||
[Route("auth")]
|
||||
public class AuthController : ControllerBase
|
||||
{
|
||||
[HttpPost("login")]
|
||||
public async Task<ActionResult<LoginResponse>> Login([FromBody] LoginRequest request)
|
||||
{
|
||||
return new LoginResponse(Guid.Parse("0196960c-6296-7532-ba66-8fabb38c6ae0"), "johnbotris", "token");
|
||||
}
|
||||
|
||||
[HttpPost("signup")]
|
||||
public async Task<ActionResult<SignupResponse>> Signup([FromBody] SignupRequest request)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpPost("delete-session")]
|
||||
public async Task<ActionResult> DeleteSession([FromBody] DeleteSessionRequest request)
|
||||
{
|
||||
// TODO
|
||||
return Ok(new {});
|
||||
}
|
||||
}
|
3
Femto.Api/Controllers/Auth/DeleteSessionRequest.cs
Normal file
3
Femto.Api/Controllers/Auth/DeleteSessionRequest.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace Femto.Api.Controllers.Auth;
|
||||
|
||||
public record DeleteSessionRequest(string SessionToken);
|
3
Femto.Api/Controllers/Auth/LoginRequest.cs
Normal file
3
Femto.Api/Controllers/Auth/LoginRequest.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace Femto.Api.Controllers.Auth;
|
||||
|
||||
public record LoginRequest(string Username, string Password);
|
3
Femto.Api/Controllers/Auth/LoginResponse.cs
Normal file
3
Femto.Api/Controllers/Auth/LoginResponse.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace Femto.Api.Controllers.Auth;
|
||||
|
||||
public record LoginResponse(Guid UserId, string Username, string SessionToken);
|
3
Femto.Api/Controllers/Auth/SignupRequest.cs
Normal file
3
Femto.Api/Controllers/Auth/SignupRequest.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace Femto.Api.Controllers.Auth;
|
||||
|
||||
public record SignupRequest(string Username, string Password, string SignupCode, string? Email);
|
3
Femto.Api/Controllers/Auth/SignupResponse.cs
Normal file
3
Femto.Api/Controllers/Auth/SignupResponse.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace Femto.Api.Controllers.Auth;
|
||||
|
||||
public record SignupResponse(Guid UserId, string Username, string SessionToken);
|
Loading…
Add table
Add a link
Reference in a new issue