aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/Endpoints/Account/DeleteEndpoint.cs
diff options
context:
space:
mode:
Diffstat (limited to 'code/api/Endpoints/Account/DeleteEndpoint.cs')
-rw-r--r--code/api/Endpoints/Account/DeleteEndpoint.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/code/api/Endpoints/Account/DeleteEndpoint.cs b/code/api/Endpoints/Account/DeleteEndpoint.cs
new file mode 100644
index 0000000..75a508a
--- /dev/null
+++ b/code/api/Endpoints/Account/DeleteEndpoint.cs
@@ -0,0 +1,17 @@
+namespace I2R.Storage.Api.Endpoints.Account;
+
+public class DeleteEndpoint : EndpointBase
+{
+ private readonly UserService _userService;
+
+ public DeleteEndpoint(UserService userService) {
+ _userService = userService;
+ }
+
+ [HttpDelete("~/account/delete")]
+ public async Task<ActionResult> Handle() {
+ await _userService.MarkUserAsDeletedAsync(LoggedInUser.Id, LoggedInUser.Id);
+ await _userService.LogOutUserAsync(HttpContext);
+ return Ok();
+ }
+} \ No newline at end of file