Skip to content

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

Return bad request if no refresh token is provided (#407)

Leendert de Borstc7f6375fbb8a
diff --git a/src/AliasVault.Api/Controllers/AuthController.cs b/src/AliasVault.Api/Controllers/AuthController.cs
index 3fe3ca8a0..f69cfb659 100644
--- a/src/AliasVault.Api/Controllers/AuthController.cs
+++ b/src/AliasVault.Api/Controllers/AuthController.cs
@@ -244,6 +244,12 @@ public class AuthController(IDbContextFactory<AliasServerDbContext> dbContextFac
{
await using var context = await dbContextFactory.CreateDbContextAsync();
+ // If the token is not provided, return bad request.
+ if (string.IsNullOrWhiteSpace(tokenModel.RefreshToken))
+ {
+ return BadRequest("Refresh token is required.");
+ }
+
var principal = GetPrincipalFromToken(tokenModel.Token);
if (principal.FindFirst(ClaimTypes.NameIdentifier)?.Value == null)
{