initial commit

This commit is contained in:
2026-07-21 14:35:37 +07:00
commit 0027997ff9
798 changed files with 59083 additions and 0 deletions
@@ -0,0 +1,67 @@
@page "/account/confirm-email"
@layout AuthenticationLayout
@using Indotalent.Shared.Consts
@using Microsoft.AspNetCore.Identity
@using Microsoft.AspNetCore.WebUtilities
@using System.Text
@using Indotalent.Data.Entities
@inject UserManager<ApplicationUser> UserManager
@inject NavigationManager Navigation
@inject ISnackbar Snackbar
<PageTitle>Confirming Email - @GlobalConsts.AppInitial</PageTitle>
<div class="confirm-container">
<div class="confirm-icon-wrapper">
<div class="confirm-icon-circle">
<MudProgressCircular Color="Color.Primary" Indeterminate="true" Size="Size.Large" />
</div>
</div>
<div class="confirm-title">Verifying Your Account</div>
<div class="confirm-desc">Please wait while we validate your email address...</div>
</div>
@code {
[SupplyParameterFromQuery] public string? userId { get; set; }
[SupplyParameterFromQuery] public string? code { get; set; }
protected override async Task OnInitializedAsync()
{
if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(code))
{
Snackbar.Add("Invalid or expired confirmation link.", Severity.Error);
Navigation.NavigateTo("/account/login");
return;
}
var user = await UserManager.FindByIdAsync(userId);
if (user == null)
{
Snackbar.Add("User record not found.", Severity.Error);
Navigation.NavigateTo("/account/login");
return;
}
try
{
var decodedCode = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code));
var result = await UserManager.ConfirmEmailAsync(user, decodedCode);
await Task.Delay(500);
if (result.Succeeded)
{
Snackbar.Add("Email verified successfully! You can now sign in.", Severity.Success);
}
else
{
Snackbar.Add("Verification failed. The link may have expired.", Severity.Error);
}
}
catch
{
Snackbar.Add("An error occurred during verification.", Severity.Error);
}
Navigation.NavigateTo("/account/login");
}
}