Skip to content

Commit

Permalink
Allow unverified users to access /filter, but still blocking commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyley committed Aug 8, 2024
1 parent e8889b9 commit 00af8a5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Refresh.GameServer/Endpoints/Game/ModerationEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public SerializedModeratedResourceList ModerateResources(RequestContext context,
/// <param name="database">The database. Used for commands</param>
/// <returns>The string shown in-game.</returns>
[GameEndpoint("filter", HttpMethods.Post)]
[RequireEmailVerified]
[AllowEmptyBody]
public string Filter(RequestContext context, CommandService commandService, string body, GameUser user, Token token, GameDatabaseContext database)
{
Expand All @@ -67,8 +66,8 @@ public string Filter(RequestContext context, CommandService commandService, stri
{
context.Logger.LogInfo(BunkumCategory.Filter, $"<{user}>: {body}");

//If the text starts with a `/`, its a command
if (body.StartsWith('/'))
//If the text starts with a `/`, its a command, also only allow verified users to use commands
if (body.StartsWith('/') && user.EmailAddressVerified)
{
try
{
Expand Down

0 comments on commit 00af8a5

Please sign in to comment.