Skip to content

Commit

Permalink
Mfa improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeViper committed Jan 28, 2025
1 parent c50a124 commit 62b7234
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,13 @@ else
Description = "Enter your password to disable Multi-Factor Authentication",
OnConfirmAsync = async (password) =>
{
var result = await AuthService.RemoveMfaAsync(password);

var result = await ToastContainer.Instance.WaitToastWithTaskResult(new ProgressToastData<TaskResult>()
{
ProgressTask = AuthService.RemoveMfaAsync(password),
Title = "Removing MFA",
Message = "Verifying password...",
});

if (result.Success)
{
_multiAuthMethods = new List<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@

private async Task OnClickMultiFactorAuth()
{
var multiResult = await AuthService.VerifyMfaAsync(_multiFactorCode);
if (multiResult.Success)
var result = await ToastContainer.Instance.WaitToastWithTaskResult(new ProgressToastData<TaskResult>()
{
ProgressTask = AuthService.VerifyMfaAsync(_multiFactorCode),
Title = "Setting up MFA",
Message = "Sending code...",
});

if (result.Success)
{
_complete = true;
StateHasChanged();
Expand Down
2 changes: 1 addition & 1 deletion Valour/Sdk/Services/AuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public async Task<TaskResult> VerifyMfaAsync(string code)
return new TaskResult(false, result.Message);

if (!result.Data)
return new TaskResult(true, "Invalid code");
return new TaskResult(false, "Invalid code");

return TaskResult.SuccessResult;
}
Expand Down

0 comments on commit 62b7234

Please sign in to comment.