Cleanup unused translations

This commit is contained in:
Leendert de Borst
2025-08-14 18:26:07 +02:00
parent e66a87e8df
commit 03faee8d3a
5 changed files with 4 additions and 24 deletions

View File

@@ -109,8 +109,6 @@
"INVALID_AUTHENTICATOR_CODE": "Invalid authenticator code. Please try again.",
"INVALID_RECOVERY_CODE": "Invalid recovery code. Please try again.",
"REFRESH_TOKEN_REQUIRED": "Refresh token is required.",
"USER_NOT_FOUND_IN_TOKEN": "User not found in token.",
"USER_NOT_FOUND_IN_DATABASE": "User not found in database.",
"INVALID_REFRESH_TOKEN": "Invalid refresh token.",
"REFRESH_TOKEN_REVOKED_SUCCESSFULLY": "Refresh token revoked successfully.",
"PUBLIC_REGISTRATION_DISABLED": "New account registration is currently disabled on this server. Please contact the administrator.",

View File

@@ -374,8 +374,6 @@
"INVALID_AUTHENTICATOR_CODE": "Invalid authenticator code. Please try again.",
"INVALID_RECOVERY_CODE": "Invalid recovery code. Please try again.",
"REFRESH_TOKEN_REQUIRED": "Refresh token is required.",
"USER_NOT_FOUND_IN_TOKEN": "User not found in token.",
"USER_NOT_FOUND_IN_DATABASE": "User not found in database.",
"INVALID_REFRESH_TOKEN": "Invalid refresh token.",
"REFRESH_TOKEN_REVOKED_SUCCESSFULLY": "Refresh token revoked successfully.",
"PUBLIC_REGISTRATION_DISABLED": "New account registration is currently disabled on this server. Please contact the administrator.",

View File

@@ -296,13 +296,13 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
var principal = GetPrincipalFromToken(tokenModel.Token);
if (principal.FindFirst(ClaimTypes.NameIdentifier)?.Value == null)
{
return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USER_NOT_FOUND_IN_TOKEN, 401));
return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USER_NOT_FOUND, 401));
}
var user = await userManager.FindByIdAsync(principal.FindFirst(ClaimTypes.NameIdentifier)?.Value ?? string.Empty);
if (user == null)
{
return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USER_NOT_FOUND_IN_DATABASE, 401));
return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USER_NOT_FOUND, 401));
}
// Check if the account is blocked.
@@ -345,13 +345,13 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
var principal = GetPrincipalFromToken(model.Token);
if (principal.FindFirst(ClaimTypes.NameIdentifier)?.Value == null)
{
return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USER_NOT_FOUND_IN_TOKEN, 401));
return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USER_NOT_FOUND, 401));
}
var user = await userManager.FindByIdAsync(principal.FindFirst(ClaimTypes.NameIdentifier)?.Value ?? string.Empty);
if (user == null)
{
return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USER_NOT_FOUND_IN_DATABASE, 401));
return Unauthorized(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USER_NOT_FOUND, 401));
}
// Check if the refresh token is valid.

View File

@@ -119,12 +119,6 @@
<data name="REFRESH_TOKEN_REQUIRED" xml:space="preserve">
<value>Refresh token is required.</value>
</data>
<data name="USER_NOT_FOUND_IN_TOKEN" xml:space="preserve">
<value>User not found (name-1)</value>
</data>
<data name="USER_NOT_FOUND_IN_DATABASE" xml:space="preserve">
<value>User not found (name-2)</value>
</data>
<data name="ACCOUNT_BLOCKED" xml:space="preserve">
<value>Your account has been disabled. If you believe this is a mistake, please contact support.</value>
</data>

View File

@@ -19,16 +19,6 @@ public enum ApiErrorCode
/// </summary>
REFRESH_TOKEN_REQUIRED,
/// <summary>
/// User not found in the provided token.
/// </summary>
USER_NOT_FOUND_IN_TOKEN,
/// <summary>
/// User not found in the database.
/// </summary>
USER_NOT_FOUND_IN_DATABASE,
/// <summary>
/// User account is locked.
/// </summary>