Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add SrpSalt to API status endpoint response (#1118)

Leendert de Borst65413c7ab7e4
diff --git a/apps/server/AliasVault.Api/Controllers/AuthController.cs b/apps/server/AliasVault.Api/Controllers/AuthController.cs
index 48079c8ff..d9aaee0ca 100644
--- a/apps/server/AliasVault.Api/Controllers/AuthController.cs
+++ b/apps/server/AliasVault.Api/Controllers/AuthController.cs
@@ -109,6 +109,7 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
ClientVersionSupported = clientSupported,
ServerVersion = AppInfo.GetFullVersion(),
VaultRevision = latestRevision,
+ SrpSalt = latestVault?.Salt ?? string.Empty,
});
}
@@ -597,7 +598,7 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
}
/// <summary>
- /// Get the JWT key from the environment variables or container secrets.
+ /// Get the JWT key from the container secrets or environment variables.
/// </summary>
/// <returns>JWT key as string.</returns>
/// <exception cref="KeyNotFoundException">Thrown if JWT key cannot be found.</exception>
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/StatusResponse.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/StatusResponse.cs
index 2d091ba11..a25622231 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/StatusResponse.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/StatusResponse.cs
@@ -29,4 +29,11 @@ public class StatusResponse
/// can use to determine if it should refresh the vault from the server.
/// </summary>
public required long VaultRevision { get; set; }
+
+ /// <summary>
+ /// Gets or sets the SRP salt. This is used by the client to validate that the local encryption key
+ /// still matches the latest vault revision. If it doesn't match, the client should trigger a logout
+ /// to make the user re-authenticate with the new password.
+ /// </summary>
+ public required string SrpSalt { get; set; }
}