Skip to content

Commit f9c6fde

Browse files
committed
Merge branch 'develop' into feature/device-estop-and-reboot
2 parents 95e2dd5 + e86aeaa commit f9c6fde

62 files changed

Lines changed: 239 additions & 176 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎API.IntegrationTests/API.IntegrationTests.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.6" />
10+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.7" />
1111
<PackageReference Include="Testcontainers.PostgreSql" Version="4.6.0" />
1212
<PackageReference Include="Testcontainers.Redis" Version="4.6.0" />
1313
<PackageReference Include="TUnit" Version="0.25.21" />

‎API/API.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="../Shared.props" />
44

55
<ItemGroup>
6-
<PackageReference Include="Fluid.Core" Version="2.24.0" />
6+
<PackageReference Include="Fluid.Core" Version="2.25.0" />
77
<PackageReference Include="MailKit" Version="4.13.0" />
88
</ItemGroup>
99

‎API/Controller/Account/Authenticated/ChangePassword.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task<IActionResult> ChangePassword(ChangePasswordRequest data)
2222
return Problem(AccountError.PasswordChangeInvalidPassword);
2323
}
2424

25-
var result = await _accountService.ChangePassword(CurrentUser.Id, data.NewPassword);
25+
var result = await _accountService.ChangePasswordAsync(CurrentUser.Id, data.NewPassword);
2626

2727
return result.Match(success => Ok(),
2828
notFound => throw new Exception("Unexpected result, apparently our current user does not exist..."));

‎API/Controller/Account/Authenticated/ChangeUsername.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public sealed partial class AuthenticatedAccountController
2222
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status403Forbidden, MediaTypeNames.Application.ProblemJson)] // UsernameRecentlyChanged
2323
public async Task<IActionResult> ChangeUsername(ChangeUsernameRequest data)
2424
{
25-
var result = await _accountService.ChangeUsername(CurrentUser.Id, data.Username,
25+
var result = await _accountService.ChangeUsernameAsync(CurrentUser.Id, data.Username,
2626
CurrentUser.Roles.Any(r => r is RoleType.Staff or RoleType.Admin or RoleType.System));
2727

2828
return result.Match<IActionResult>(

‎API/Controller/Account/Authenticated/Deactivate.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public sealed partial class AuthenticatedAccountController
1616
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status403Forbidden, MediaTypeNames.Application.ProblemJson)] // CannotDeactivatePrivledgedAccount
1717
public async Task<IActionResult> Deactivate()
1818
{
19-
var deactivationResult = await _accountService.DeactivateAccount(CurrentUser.Id, CurrentUser.Id, deleteLater: true);
19+
var deactivationResult = await _accountService.DeactivateAccountAsync(CurrentUser.Id, CurrentUser.Id, deleteLater: true);
2020
return deactivationResult.Match(
2121
success => Ok("Account deactivated"),
2222
cannotDeactivatePrivledged => Problem(AccountActivationError.CannotDeactivateOrDeletePrivledgedAccount),

‎API/Controller/Account/CheckUsername.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public sealed partial class AccountController
1616
[HttpPost("username/check")]
1717
public async Task<UsernameCheckResponse> CheckUsername(ChangeUsernameRequest data, CancellationToken cancellationToken)
1818
{
19-
var result = await _accountService.CheckUsernameAvailability(data.Username, cancellationToken);
19+
var result = await _accountService.CheckUsernameAvailabilityAsync(data.Username, cancellationToken);
2020

2121
return result.Match(
2222
success => new UsernameCheckResponse(UsernameAvailability.Available),

‎API/Controller/Account/Login.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public async Task<IActionResult> Login(
3232
var cookieDomainToUse = options.Value.CookieDomain.Split(',').FirstOrDefault(domain => Request.Headers.Host.ToString().EndsWith(domain, StringComparison.OrdinalIgnoreCase));
3333
if (cookieDomainToUse is null) return Problem(LoginError.InvalidDomain);
3434

35-
var loginAction = await _accountService.Login(body.Email, body.Password, new LoginContext
35+
var loginAction = await _accountService.CreateUserLoginSessionAsync(body.Email, body.Password, new LoginContext
3636
{
3737
Ip = HttpContext.GetRemoteIP().ToString(),
3838
UserAgent = HttpContext.GetUserAgent(),

‎API/Controller/Account/LoginV2.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public async Task<IActionResult> LoginV2(
3737

3838
var remoteIP = HttpContext.GetRemoteIP();
3939

40-
var turnStile = await turnstileService.VerifyUserResponseToken(body.TurnstileResponse, remoteIP, cancellationToken);
40+
var turnStile = await turnstileService.VerifyUserResponseTokenAsync(body.TurnstileResponse, remoteIP, cancellationToken);
4141
if (!turnStile.IsT0)
4242
{
4343
var cfErrors = turnStile.AsT1.Value;
@@ -47,7 +47,7 @@ public async Task<IActionResult> LoginV2(
4747
return Problem(new OpenShockProblem("InternalServerError", "Internal Server Error", HttpStatusCode.InternalServerError));
4848
}
4949

50-
var loginAction = await _accountService.Login(body.UsernameOrEmail, body.Password, new LoginContext
50+
var loginAction = await _accountService.CreateUserLoginSessionAsync(body.UsernameOrEmail, body.Password, new LoginContext
5151
{
5252
Ip = remoteIP.ToString(),
5353
UserAgent = HttpContext.GetUserAgent(),

‎API/Controller/Account/Logout.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public async Task<IActionResult> Logout(
2121
// Remove session if valid
2222
if (HttpContext.TryGetUserSessionToken(out var sessionToken))
2323
{
24-
await sessionService.DeleteSessionByToken(sessionToken);
24+
await sessionService.DeleteSessionByTokenAsync(sessionToken);
2525
}
2626

2727
// Make sure cookie is removed, no matter if authenticated or not

‎API/Controller/Account/PasswordResetCheckValid.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public sealed partial class AccountController
2323
[MapToApiVersion("1")]
2424
public async Task<IActionResult> PasswordResetCheckValid([FromRoute] Guid passwordResetId, [FromRoute] string secret, CancellationToken cancellationToken)
2525
{
26-
var passwordResetExists = await _accountService.PasswordResetExists(passwordResetId, secret, cancellationToken);
26+
var passwordResetExists = await _accountService.CheckPasswordResetExistsAsync(passwordResetId, secret, cancellationToken);
2727
return passwordResetExists.Match(
2828
success => LegacyEmptyOk("Valid password reset process"),
2929
notFound => Problem(PasswordResetError.PasswordResetNotFound),

0 commit comments

Comments
 (0)