Handle already signed envelopes in LoginReceiverPage
Updated the `OnInitializedAsync` method in `LoginReceiverPage.razor` to handle cases where the envelope has already been signed. The method now checks the result of `RequestEnvelopeReceiverAccessCodeAsync` and redirects the user to the `/envelope/signed-result` page if the result is `SendAccessCodeResult.AlreadySigned`.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
@page "/envelope/login/{EnvelopeKey}"
|
@page "/envelope/login/{EnvelopeKey}"
|
||||||
@rendermode InteractiveWebAssembly
|
@rendermode InteractiveWebAssembly
|
||||||
@using EnvelopeGenerator.Server.Client.Services
|
@using EnvelopeGenerator.Server.Client.Services
|
||||||
|
@using EnvelopeGenerator.Application.EnvelopeReceivers.Commands
|
||||||
@using EnvelopeGenerator.Application.Resources
|
@using EnvelopeGenerator.Application.Resources
|
||||||
@using Microsoft.Extensions.Localization
|
@using Microsoft.Extensions.Localization
|
||||||
@inject AuthService AuthService
|
@inject AuthService AuthService
|
||||||
@@ -149,7 +150,12 @@
|
|||||||
if (string.IsNullOrWhiteSpace(EnvelopeKey))
|
if (string.IsNullOrWhiteSpace(EnvelopeKey))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_ = await AuthService.RequestEnvelopeReceiverAccessCodeAsync(EnvelopeKey);
|
var requestResult = await AuthService.RequestEnvelopeReceiverAccessCodeAsync(EnvelopeKey);
|
||||||
|
if (requestResult == SendAccessCodeResult.AlreadySigned)
|
||||||
|
{
|
||||||
|
Navigation.NavigateTo("/envelope/signed-result", forceLoad: false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task OnKeyDownAsync(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs e)
|
async Task OnKeyDownAsync(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user