feat: self-service deletion API, reactivate account page

This commit is contained in:
sam 2024-12-19 16:13:05 +01:00
parent 8a2ffd7d69
commit 96725cc304
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
13 changed files with 183 additions and 17 deletions

View file

@ -41,7 +41,7 @@ public class LimitMiddleware : IMiddleware
return;
}
if (token?.User.Deleted == true && !attribute.UsableBySuspendedUsers)
if (token?.User.Deleted == true && !attribute.UsableByDeletedUsers)
throw new ApiError.Forbidden("Deleted users cannot access this endpoint.");
if (attribute.RequireAdmin && token?.User.Role != UserRole.Admin)
@ -62,7 +62,7 @@ public class LimitMiddleware : IMiddleware
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class LimitAttribute : Attribute
{
public bool UsableBySuspendedUsers { get; init; }
public bool UsableByDeletedUsers { get; init; }
public bool RequireAdmin { get; init; }
public bool RequireModerator { get; init; }
}