using System.Threading.Tasks;
using DiplomovaPrace.Contracts.Security.InputModels;
using DiplomovaPrace.Web.Admin.Services;
using Microsoft.AspNetCore.Components;

namespace DiplomovaPrace.Web.Admin.Pages.Security
{
	public partial class ForgottenPassword
	{
		[Inject]
		private ISecurityService SecurityService { get; set; }

		private ForgottenPasswordIM forgottenPassword = new();

		protected override async Task OnInitializedAsync()
		{
			await base.OnInitializedAsync().ConfigureAwait(false);
		}

		private async Task HandleSubmitAsync()
		{
			await SecurityService.RecoverForgottenPasswordAsync(forgottenPassword).ConfigureAwait(false);
		}
	}
}
