private async Task UpdateProfileInfoAsync() { try { await ButtonUpdateProfile.SpinAsync(async() => { await ApplicationUserService.UpdateProfileInfoAsync(UserProfileModel); await IdentityApiClient.RefreshSignInAsync(); await ToastService.ShowToastAsync("Your profile has been updated.", ToastType.Success); }); } catch (Exception ex) { Logger.LogError(ex.Message); await ToastService.ShowToastAsync(ex.Message, ToastType.Error); } }
private async Task ChangePasswordAsync() { try { await ButtonChangePassword.SpinAsync(async() => { await ApplicationUserService.UpdateAccountPasswordAsync(ChangePasswordModel); await IdentityApiClient.RefreshSignInAsync(); await ToastService.ShowToastAsync("Password updated.", ToastType.Success); ChangePasswordModel = new ChangePasswordModel() { UserId = CurrentUser.Id }; }); } catch (Exception ex) { Logger.LogError(ex.Message); await ToastService.ShowToastAsync(ex.Message, ToastType.Error); } }