Skip to content

Commit

Permalink
Merge pull request #95 from Gml-Launcher/1.0.2
Browse files Browse the repository at this point in the history
Update to v1.0.2
  • Loading branch information
GamerVII-NET authored Dec 5, 2024
2 parents a7696aa + 9f9694a commit dfff83a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Gml.Core
Submodule Gml.Core updated 0 files
3 changes: 0 additions & 3 deletions src/Gml.Web.Api.Domains/Integrations/UnicoreAuthResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public class User
[JsonProperty("password")]
public string Password { get; set; }

[JsonProperty("superuser")]
public bool Superuser { get; set; }

[JsonProperty("activated")]
public bool Activated { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/Gml.Web.Api/Core/Handlers/AuthIntegrationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ public static async Task<IResult> AuthWithToken(
"Не удалось определить устройство, с которого произошла авторизация",
HttpStatusCode.BadRequest));

if (authType is not AuthType.Any && string.IsNullOrEmpty(authDto.Password))
if (authType is not AuthType.Any && string.IsNullOrEmpty(authDto.AccessToken))
{
return Results.BadRequest(ResponseMessage.Create(
"Не указан пароль при авторизации!",
"Не был передан AccessToken",
HttpStatusCode.BadRequest));
}

Expand Down
9 changes: 9 additions & 0 deletions src/Gml.Web.Api/Core/Integrations/Auth/AzuriomAuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ public async Task<AuthResult> Auth(string login, string password)

var model = JsonConvert.DeserializeObject<AzuriomAuthResult>(resultContent);

if (!result.IsSuccessStatusCode && resultContent.Contains("invalid_credentials", StringComparison.OrdinalIgnoreCase))
{
return new AuthResult
{
IsSuccess = false,
Message = $"Неверный логин или пароль."
};
}

if (model is null || model.Banned || !result.IsSuccessStatusCode || (!result.IsSuccessStatusCode && resultContent.Contains("banned", StringComparison.OrdinalIgnoreCase)))
{
return new AuthResult
Expand Down

0 comments on commit dfff83a

Please sign in to comment.