chore(backend): add roslynator and fix diagnostics
This commit is contained in:
parent
649988db25
commit
f8e6032449
20 changed files with 60 additions and 38 deletions
|
@ -38,7 +38,7 @@ public class AuthController(
|
|||
if (config.DiscordAuth is { ClientId: not null, ClientSecret: not null })
|
||||
{
|
||||
discord =
|
||||
$"https://discord.com/oauth2/authorize?response_type=code"
|
||||
"https://discord.com/oauth2/authorize?response_type=code"
|
||||
+ $"&client_id={config.DiscordAuth.ClientId}&scope=identify"
|
||||
+ $"&prompt=none&state={state}"
|
||||
+ $"&redirect_uri={HttpUtility.UrlEncode($"{config.BaseUrl}/auth/callback/discord")}";
|
||||
|
|
|
@ -104,7 +104,7 @@ public class DiscordAuthController(
|
|||
);
|
||||
|
||||
string url =
|
||||
$"https://discord.com/oauth2/authorize?response_type=code"
|
||||
"https://discord.com/oauth2/authorize?response_type=code"
|
||||
+ $"&client_id={config.DiscordAuth.ClientId}&scope=identify"
|
||||
+ $"&prompt=none&state={state}"
|
||||
+ $"&redirect_uri={HttpUtility.UrlEncode($"{config.BaseUrl}/auth/callback/discord")}";
|
||||
|
|
|
@ -48,7 +48,9 @@ public class EmailAuthController(
|
|||
ct
|
||||
)
|
||||
)
|
||||
{
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
mailService.QueueAccountCreationEmail(req.Email, state);
|
||||
return NoContent();
|
||||
|
|
|
@ -124,7 +124,9 @@ public class FlagsController(
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Debug("Flag file {Hash} is used by other flags, not deleting", hash);
|
||||
}
|
||||
|
||||
await tx.CommitAsync();
|
||||
|
||||
|
|
|
@ -93,12 +93,14 @@ public partial class InternalController(DatabaseContext db) : ControllerBase
|
|||
HttpMethodAttribute? httpMethodAttribute =
|
||||
endpoint.Metadata.GetMetadata<HttpMethodAttribute>();
|
||||
if (
|
||||
httpMethodAttribute != null
|
||||
&& !httpMethodAttribute.HttpMethods.Any(x =>
|
||||
httpMethodAttribute?.HttpMethods.Any(x =>
|
||||
x.Equals(requestMethod, StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
) == false
|
||||
)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ public class MembersController(
|
|||
throw new ApiError.BadRequest(
|
||||
"A member with that name already exists",
|
||||
"name",
|
||||
req.Name!
|
||||
req.Name
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,9 @@ public class UsersController(
|
|||
else
|
||||
{
|
||||
if (TimeZoneInfo.TryFindSystemTimeZoneById(req.Timezone, out _))
|
||||
{
|
||||
user.Timezone = req.Timezone;
|
||||
}
|
||||
else
|
||||
{
|
||||
errors.Add(
|
||||
|
@ -174,7 +176,7 @@ public class UsersController(
|
|||
throw new ApiError.BadRequest(
|
||||
"That username is already taken.",
|
||||
"username",
|
||||
req.Username!
|
||||
req.Username
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue