From 6d9b4d98ae35d32316dcc40e2ddb9b37b691e747 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 8 Jun 2026 00:45:26 +0200 Subject: [PATCH] Add envelope access check and update thumbnail width Updated `MaxThumbnailWidth` to 400 in `EnvelopeViewer.razor`. Added an authentication check using `AuthService.CheckEnvelopeAccessAsync` to ensure users have access to the envelope. Redirects unauthorized users to a login page with the `EnvelopeKey` in the URL. The check is performed before fetching the document via `DocumentService`. --- EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor b/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor index 422f4fc1..17740bf1 100644 --- a/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor +++ b/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor @@ -435,6 +435,13 @@ const int MaxThumbnailWidth = 400; return; } + // Check authentication + var hasAccess = await AuthService.CheckEnvelopeAccessAsync(EnvelopeKey); + if (!hasAccess) { + Navigation.NavigateTo($"/login/{Uri.EscapeDataString(EnvelopeKey)}"); + return; + } + try { var (pdfBytes, statusCode) = await DocumentService.GetDocumentAsync(EnvelopeKey);