1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

fix error code page for things over than 404s

allow request token when not logged in
This commit is contained in:
RaidMax
2020-01-14 18:56:23 -06:00
parent 9330e8057e
commit 877a904bb0
3 changed files with 19 additions and 4 deletions

View File

@ -2,6 +2,7 @@
using System.Reflection;
using System.Threading.Tasks;
using SharedLibraryCore;
using SharedLibraryCore.Commands;
using SharedLibraryCore.Configuration;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Exceptions;
@ -42,13 +43,16 @@ namespace IW4MAdmin.Plugins.Login
E.Origin.Level == EFClient.Permission.Console)
return Task.CompletedTask;
if (((Command)E.Extra).Name == new SharedLibraryCore.Commands.CSetPassword().Name &&
if (((Command)E.Extra).Name == new CSetPassword().Name &&
E.Origin?.Password == null)
return Task.CompletedTask;
if (((Command)E.Extra).Name == new Commands.CLogin().Name)
return Task.CompletedTask;
if (E.Extra.GetType() == typeof(RequestTokenCommand))
return Task.CompletedTask;
if (!AuthorizedClients[E.Origin.ClientId])
{
throw new AuthorizationException(Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_LOGIN_AUTH"]);