Refactor claim handling and simplify controllers
Refactored multiple controllers (`AnnotationController`, `DocumentController`, `ReadOnlyController`, and `SignatureController`) to use updated claim extension methods (`ReceiverSignature`, `EnvelopeUuid`, etc.), replacing older, verbose methods for improved readability and consistency. Removed the `EnvelopeClaimTypes` class and replaced claim type constants with `EnvelopeClaimNames`. Simplified claim retrieval logic in `ReceiverClaimExtensions` by consolidating methods and removing redundant or unused functionality. Eliminated the `SignInEnvelopeAsync` method, indicating a shift away from manual claim management. Performed general cleanup, including removing obsolete code and improving exception messages for better debugging context.
This commit is contained in:
@@ -51,7 +51,7 @@ public class DocumentController(IMediator mediator, IAuthorizationService authSe
|
||||
if (query is not null)
|
||||
return BadRequest("Query parameters are not allowed for receiver role.");
|
||||
|
||||
var envelopeId = User.GetEnvelopeIdOfReceiver();
|
||||
var envelopeId = User.EnvelopeId();
|
||||
var receiverDoc = await mediator.Send(new ReadDocumentQuery { EnvelopeId = envelopeId }, cancel);
|
||||
return receiverDoc.ByteData is byte[] receiverDocByte
|
||||
? File(receiverDocByte, "application/octet-stream")
|
||||
@@ -71,7 +71,7 @@ public class DocumentController(IMediator mediator, IAuthorizationService authSe
|
||||
[HttpGet("{envelopeKey}")]
|
||||
public async Task<IActionResult> GetDocumentOfReceiver(string envelopeKey, CancellationToken cancel)
|
||||
{
|
||||
int envelopeId = User.GetEnvelopeIdOfReceiver();
|
||||
int envelopeId = User.EnvelopeId();
|
||||
|
||||
var senderDoc = await mediator.Send(new ReadDocumentQuery() { EnvelopeId = envelopeId }, cancel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user