diff --git a/EnvelopeGenerator.ReceiverUI/Services/AuthService.cs b/EnvelopeGenerator.ReceiverUI/Services/AuthService.cs index c0b020dd..4fa759ee 100644 --- a/EnvelopeGenerator.ReceiverUI/Services/AuthService.cs +++ b/EnvelopeGenerator.ReceiverUI/Services/AuthService.cs @@ -78,4 +78,16 @@ public class AuthService(HttpClient http, IOptions apiOptions) _ => SenderLoginResult.Error }; } + + /// + /// Logs out the sender user by removing the authentication cookie. + /// Calls POST /api/auth/logout. + /// + public async Task LogoutSenderAsync(CancellationToken cancel = default) + { + var response = await http.PostAsync( + $"{_api.BaseUrl}/api/auth/logout", + null, cancel); + return response.IsSuccessStatusCode; + } }