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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user