fix bugs, improve security

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-09-22 00:34:37 +03:00
parent 0af74ec278
commit a4295c6c52
5 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.10.0" />
<PackageReference Include="linq2db" Version="5.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Npgsql" Version="8.0.5" />
</ItemGroup>
+1 -1
View File
@@ -22,7 +22,7 @@
<ItemGroup>
<PackageReference Include="LazyCache.AspNetCore" Version="2.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.1.2" />
</ItemGroup>
+1 -1
View File
@@ -122,7 +122,7 @@ public class UserService(IDbFactory dbFactory, ICache cache) : IUserService
private async Task UpdateLastLoginDate(User user, CancellationToken ct = default)
{
await dbFactory.Run(async db =>
await dbFactory.RunAdmin(async db =>
await db.Users.UpdateAsync(x => x.Email == user.Email, u => new User
{
LastLogin = DateTime.UtcNow
+2
View File
@@ -18,6 +18,8 @@ public class UserServiceTest
}));
var userService = new UserService(dbFactory, new MemoryCache());
var user = await userService.GetByEmail("spielberg@azaion.com");
if (user == null)
throw new Exception("User not found");
var res = await userService.CheckHardwareHash(user,
"CPU: AMD Ryzen 9 3900XT 12-Core Processor. GPU: Microsoft Remote Display Adapter. Memory: 67037080. DriveSerial: PHMB746301G6480DGN _00000001.");
+3 -3
View File
@@ -6,6 +6,6 @@
& "setx" "foo" "bar"
setx ASPNETCORE_ConnectionStrings__AzaionDb Host=localhost;Database=azaion;Username=azaion_reader;Password=Az@1on_re@d!only@$Az;
setx ASPNETCORE_ConnectionStrings__AzaionDbAdmin Host=localhost;Database=azaion;Username=azaion_admin;Password=Az@1on_admin$$@r;
setx ASPNETCORE_JwtConfig__Secret sdkfjghbsdfklhjgvbsdkljfhbvasklhfgsdfvh
setx ASPNETCORE_ConnectionStrings__AzaionDb Host=localhost;Database=azaion;Username=azaion_reader;Password=Az_read;
setx ASPNETCORE_ConnectionStrings__AzaionDbAdmin Host=localhost;Database=azaion;Username=azaion_admin;Password=Az_admin;
setx ASPNETCORE_JwtConfig__Secret jwt_secret