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`.
This commit is contained in:
2026-06-08 00:45:26 +02:00
parent 334fc35b26
commit 6d9b4d98ae

View File

@@ -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);