48 lines
1.5 KiB
Plaintext
Executable File
48 lines
1.5 KiB
Plaintext
Executable File
@page "/forgotpassword"
|
|
@* @using System.ComponentModel.DataAnnotations *@
|
|
@inject UserAPIConsumer userAPIConsumer
|
|
@layout EmptyLayout
|
|
|
|
<div class="container px-5 py-24 mx-auto flex flex-wrap items-center">
|
|
|
|
<div class="lg:w-2/6 md:w-1/2 bg-gray-100 rounded-lg p-8 flex flex-col mx-auto w-full mt-10 md:mt-0">
|
|
<h2 class="text-gray-900 text-lg font-medium title-font mb-5">Reset your Password</h2>
|
|
|
|
|
|
<div class="relative mb-4">
|
|
<label for="email" class="leading-7 text-sm text-gray-600">Email</label>
|
|
<input type="email" placeholder="Email" @bind="Email" id="email"
|
|
class="w-full bg-white rounded border border-gray-300 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out" />
|
|
|
|
</div>
|
|
|
|
|
|
<button @onclick="ResetPassword" type="button"
|
|
class="text-white mt-4 bg-indigo-500 border-0 py-2 px-8 focus:outline-none hover:bg-indigo-600 rounded text-lg">Reset
|
|
Password</button>
|
|
<p class='text-md text-center font-bold @(isSuccessful ? "text-green-500" : "text-red-500") mt-4'>@resultMessage
|
|
</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
|
|
string resultMessage = "";
|
|
bool isSuccessful = false;
|
|
|
|
|
|
public string Email { get; set; }
|
|
|
|
async Task ResetPassword()
|
|
{
|
|
isSuccessful = await userAPIConsumer.RequestResetPassword(Email);
|
|
if (isSuccessful)
|
|
resultMessage = "Email Sent.";
|
|
else
|
|
resultMessage = "Error.";
|
|
}
|
|
|
|
}
|