mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
style: format via prettier/csharpier
This commit is contained in:
@@ -242,4 +242,4 @@ export const trustedDomains = [
|
|||||||
'cloudflare-ipfs.com',
|
'cloudflare-ipfs.com',
|
||||||
|
|
||||||
'upload.wikimedia.org'
|
'upload.wikimedia.org'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -707,15 +707,16 @@
|
|||||||
<div class="flex items-center justify-between rounded bg-neutral-800/50 p-3">
|
<div class="flex items-center justify-between rounded bg-neutral-800/50 p-3">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<span class="text-sm font-medium text-neutral-200">User Roles</span>
|
<span class="text-sm font-medium text-neutral-200">User Roles</span>
|
||||||
<span class="text-xs text-neutral-500">{(() => {
|
<span class="text-xs text-neutral-500"
|
||||||
let count = 0;
|
>{(() => {
|
||||||
if (data.user?.roles) {
|
let count = 0;
|
||||||
if (hasRole(data.user.roles, roles.User)) count++;
|
if (data.user?.roles) {
|
||||||
if (hasRole(data.user.roles, roles.Moderator)) count++;
|
if (hasRole(data.user.roles, roles.User)) count++;
|
||||||
if (hasRole(data.user.roles, roles.Admin)) count++;
|
if (hasRole(data.user.roles, roles.Moderator)) count++;
|
||||||
}
|
if (hasRole(data.user.roles, roles.Admin)) count++;
|
||||||
return count;
|
}
|
||||||
})()} roles assigned</span
|
return count;
|
||||||
|
})()} roles assigned</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ namespace SharpbinV3.Server.Authorization
|
|||||||
if (_requireAuth && !isAuthenticated)
|
if (_requireAuth && !isAuthenticated)
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|
||||||
var isBanned = bool.TryParse(context.User.Claims.FirstOrDefault(c => c.Type == "is_banned")?.Value, out var parsedIsBanned)
|
var isBanned =
|
||||||
&& parsedIsBanned;
|
bool.TryParse(context.User.Claims.FirstOrDefault(c => c.Type == "is_banned")?.Value, out var parsedIsBanned) && parsedIsBanned;
|
||||||
|
|
||||||
if (!isBanned && httpContext?.GetJwtUser()?.IsBanned == true)
|
if (!isBanned && httpContext?.GetJwtUser()?.IsBanned == true)
|
||||||
isBanned = true;
|
isBanned = true;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace SharpbinV3.Server.DTOs.Paste
|
|||||||
public long Size { get; set; }
|
public long Size { get; set; }
|
||||||
public long TrueSize { get; set; }
|
public long TrueSize { get; set; }
|
||||||
public long ExpiresAt { get; set; }
|
public long ExpiresAt { get; set; }
|
||||||
public Visibility Visibility { get; set;}
|
public Visibility Visibility { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PasteOptionsDto
|
public class PasteOptionsDto
|
||||||
|
|||||||
Reference in New Issue
Block a user