From 0019821e871f2c0552cf37558f3d77dfb4118fd6 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Tue, 13 Oct 2026 08:49:39 +0300 Subject: [PATCH] Turns the lowercase comments into sentences. --- .../Scheduler/SchedulerIndexViewEndpoint.cs | 4 ++-- .../Core/Endpoints/Common/BaseEndpoint.cs | 4 ++-- .../GetThumbnail/GetThumbnailEndpoint.cs | 2 +- .../Home/HomeNotFoundViewEndpoint.cs | 4 ++-- .../Books/Index/BooksIndexViewEndpoint.cs | 6 ++--- .../Themes/ThemeAssets/ThemeAssetsEndpoint.cs | 2 +- .../SetLanguage/SetLanguageEndpoint.cs | 12 +++++----- .../GetUserSettingsEndpoint.cs | 2 +- .../UpdateUserSettingsEndpoint.cs | 2 +- .../ChangePassword/ChangePasswordEndpoint.cs | 2 +- .../Authentication/Login/LoginEndpoint.cs | 22 +++++++++---------- .../Authentication/Login/LoginViewEndpoint.cs | 4 ++-- .../Authentication/Logout/LogoutEndpoint.cs | 2 +- .../RecoverPasswordViewEndpoint.cs | 2 +- .../Register/RegisterEndpoint.cs | 4 ++-- .../Register/RegisterViewEndpoint.cs | 2 +- 16 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Admin/Scheduler/SchedulerIndexViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Admin/Scheduler/SchedulerIndexViewEndpoint.cs index cf09450c..22be1b44 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Admin/Scheduler/SchedulerIndexViewEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Admin/Scheduler/SchedulerIndexViewEndpoint.cs @@ -26,10 +26,10 @@ namespace Lumina.Presentation.Web.Core.Endpoints.Admin.Scheduler; /// public class SchedulerIndexViewEndpoint : BaseEndpoint { - // the resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it with the configured ResourcesPath + // The resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it with the configured ResourcesPath. private const string VIEW_RESOURCE_BASE_NAME = "Lumina.Presentation.Web.Views.Admin.Scheduler"; private const string VIEW_RESOURCE_LOCATION = "Lumina.Presentation.Web"; - // the page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope + // The page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope. private const string VIEW_PAGE_KEY = "admin/scheduler"; private readonly IAntiforgery _antiforgery; diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Common/BaseEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Common/BaseEndpoint.cs index 62ca2828..f00b760c 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Common/BaseEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Common/BaseEndpoint.cs @@ -40,8 +40,8 @@ public abstract class BaseEndpoint : EndpointAn that renders the view. protected IResult View(string viewName, object? model = null, IReadOnlyDictionary? viewData = null) { - // store the path of the displayed view in the session, so that the login redirect after the JWT token expires points to it; ignore the login endpoint, - // because it is incorrect to be redirected to the login URL, with the login URL as the return URL + // Store the path of the displayed view in the session, so that the login redirect after the JWT token expires points to it; ignore the login endpoint, + // because it is incorrect to be redirected to the login URL, with the login URL as the return URL. if (HttpContext.Request.Path != "/en-us/auth/login") HttpContext.Session.SetString(HttpContextItemKeys.LAST_DISPLAYED_VIEW, $"{HttpContext.Request.PathBase}{HttpContext.Request.Path}{HttpContext.Request.QueryString}"); return new RazorViewResult(viewName, model, viewData); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Thumbnails/GetThumbnail/GetThumbnailEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Thumbnails/GetThumbnail/GetThumbnailEndpoint.cs index d0230562..88e0fb5e 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Thumbnails/GetThumbnail/GetThumbnailEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Thumbnails/GetThumbnail/GetThumbnailEndpoint.cs @@ -49,7 +49,7 @@ public class GetThumbnailEndpoint : BaseEndpoint /// Cancellation token that can be used to stop the execution. public override async Task ExecuteAsync(GetThumbnailRequest request, CancellationToken cancellationToken) { - // the thumbnail is proxied through the Web application, so that the request carries the authentication of the current user + // The thumbnail is proxied through the Web application, so that the request carries the authentication of the current user. BlobDataDto blob = await _apiHttpClient.GetBlobAsync($"{ApiRoutes.Thumbnails.GET_THUMBNAIL}?path={Uri.EscapeDataString(request.Path!)}&quality={request.Quality}", cancellationToken).ConfigureAwait(false); return Results.File(blob.Data, blob.ContentType); } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Home/HomeNotFoundViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Home/HomeNotFoundViewEndpoint.cs index 6e5c239e..155f4922 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Home/HomeNotFoundViewEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Home/HomeNotFoundViewEndpoint.cs @@ -20,10 +20,10 @@ namespace Lumina.Presentation.Web.Core.Endpoints.Home; /// public class HomeNotFoundViewEndpoint : BaseEndpoint { - // the resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it with the configured ResourcesPath + // The resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it with the configured ResourcesPath. private const string VIEW_RESOURCE_BASE_NAME = "Lumina.Presentation.Web.Views.Shared.NotFound"; private const string VIEW_RESOURCE_LOCATION = "Lumina.Presentation.Web"; - // the page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope + // The page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope. private const string VIEW_PAGE_KEY = "shared/not-found"; private readonly ThemePageRenderer _themePageRenderer; diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/Index/BooksIndexViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/Index/BooksIndexViewEndpoint.cs index f385ddfb..8f7ff097 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/Index/BooksIndexViewEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/Index/BooksIndexViewEndpoint.cs @@ -25,12 +25,12 @@ namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.B /// public class BooksIndexViewEndpoint : BaseEndpoint { - // the resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it + // The resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it // with the configured ResourcesPath, so "Lumina.Presentation.Web.Views.X" resolves to the embedded - // "Lumina.Presentation.Web.Core.Resources.Views.X" resource; including "Core" here would insert it twice + // "Lumina.Presentation.Web.Core.Resources.Views.X" resource; including "Core" here would insert it twice. private const string VIEW_RESOURCE_BASE_NAME = "Lumina.Presentation.Web.Views.Library.WrittenContentLibrary.BookLibrary.Books.Index"; private const string VIEW_RESOURCE_LOCATION = "Lumina.Presentation.Web"; - // the page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope + // The page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope. private const string VIEW_PAGE_KEY = "library/written-content-library/book-library/books/index"; private readonly IApiHttpClient _apiHttpClient; diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Themes/ThemeAssets/ThemeAssetsEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Themes/ThemeAssets/ThemeAssetsEndpoint.cs index 455c2314..889a7232 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Themes/ThemeAssets/ThemeAssetsEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Themes/ThemeAssets/ThemeAssetsEndpoint.cs @@ -51,7 +51,7 @@ public class ThemeAssetsEndpoint : BaseEndpoint if (string.IsNullOrWhiteSpace(request.ThemeId) || string.IsNullOrWhiteSpace(request.Path)) return Results.Problem(statusCode: StatusCodes.Status400BadRequest, detail: "The theme id and the asset path are required."); - // the API route token is a catch-all ("{*assetPath}"), so the replace target must include the star to match it + // The API route token is a catch-all ("{*assetPath}"), so the replace target must include the star to match it. BlobDataDto blob = await _apiHttpClient.GetBlobAsync( ApiRoutes.Themes.GET_THEME_ASSET.Replace("{themeId}", request.ThemeId).Replace("{*assetPath}", request.Path), cancellationToken).ConfigureAwait(false); return Results.File(blob.Data, blob.ContentType); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Language/SetLanguage/SetLanguageEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Language/SetLanguage/SetLanguageEndpoint.cs index 744af3c0..62d3cba0 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Language/SetLanguage/SetLanguageEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Language/SetLanguage/SetLanguageEndpoint.cs @@ -38,7 +38,7 @@ public class SetLanguageEndpoint : BaseEndpoint /// Cancellation token that can be used to stop the execution. public override async Task ExecuteAsync(SetLanguageRequest request, CancellationToken cancellationToken) { - // store the culture preference in a cookie + // Store the culture preference in a cookie. HttpContext.Response.Cookies.Append( CookieRequestCultureProvider.DefaultCookieName, CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(request.NewCulture!)), @@ -50,25 +50,25 @@ public class SetLanguageEndpoint : BaseEndpoint Path = "/" // ensure the cookie works across all paths } ); - // determine the URL to return to, defaulting to the localized home page when no return URL is supplied + // Determine the URL to return to, defaulting to the localized home page when no return URL is supplied. string newCulture = request.NewCulture!; string returnUrl = string.IsNullOrEmpty(request.ReturnUrl) ? $"/{newCulture.ToLower()}" : request.ReturnUrl; string currentCulture = Culture; - // handle the base path, so that the culture replacement matches the URL + // Handle the base path, so that the culture replacement matches the URL. if (!string.IsNullOrEmpty(HttpContext.Request.PathBase)) returnUrl = returnUrl.Replace(HttpContext.Request.PathBase.Value!, string.Empty, StringComparison.OrdinalIgnoreCase); - // replace the current culture segment of the URL with the new one, whether or not a trailing slash is present + // Replace the current culture segment of the URL with the new one, whether or not a trailing slash is present. string currentCultureSegment = $"/{currentCulture.ToLower()}"; string newCultureSegment = $"/{newCulture.ToLower()}"; if (returnUrl.StartsWith(currentCultureSegment, StringComparison.OrdinalIgnoreCase)) returnUrl = newCultureSegment + returnUrl[currentCultureSegment.Length..]; - // re-apply the base path if present + // Re-apply the base path if present. if (!string.IsNullOrEmpty(HttpContext.Request.PathBase)) returnUrl = HttpContext.Request.PathBase.Value + returnUrl; - // redirect to the target page + // Redirect to the target page. return Results.LocalRedirect(returnUrl); } } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Settings/GetUserSettings/GetUserSettingsEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Settings/GetUserSettings/GetUserSettingsEndpoint.cs index 4e899751..bab52a28 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Settings/GetUserSettings/GetUserSettingsEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Settings/GetUserSettings/GetUserSettingsEndpoint.cs @@ -55,7 +55,7 @@ public class GetUserSettingsEndpoint : BaseEndpoint { UserSettingsDto response = await _apiHttpClient.GetAsync(ApiRoutes.Users.GET_USER_SETTINGS, cancellationToken).ConfigureAwait(false); - // refresh the per-user theme cache preference from the stored settings, so the handler always applies the latest value + // Refresh the per-user theme cache preference from the stored settings, so the handler always applies the latest value. Guid? userId = GetCurrentUserId(); if (userId is not null) await _themeCachePreferenceService.SetAsync(userId.Value, response.IsThemeCachingEnabled, cancellationToken).ConfigureAwait(false); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Settings/UpdateUserSettings/UpdateUserSettingsEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Settings/UpdateUserSettings/UpdateUserSettingsEndpoint.cs index 82530e78..1dd83b01 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Settings/UpdateUserSettings/UpdateUserSettingsEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Tools/Settings/UpdateUserSettings/UpdateUserSettingsEndpoint.cs @@ -56,7 +56,7 @@ public class UpdateUserSettingsEndpoint : BaseEndpoint { await _apiHttpClient.PutAsync(ApiRoutes.Users.UPDATE_USER_SETTINGS, request, cancellationToken).ConfigureAwait(false); - // keep the per-user theme cache preference in sync with the stored settings, so the handler applies it immediately + // Keep the per-user theme cache preference in sync with the stored settings, so the handler applies it immediately. Guid? userId = GetCurrentUserId(); if (userId is not null) await _themeCachePreferenceService.SetAsync(userId.Value, request.IsThemeCachingEnabled, cancellationToken).ConfigureAwait(false); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/ChangePassword/ChangePasswordEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/ChangePassword/ChangePasswordEndpoint.cs index 2e26cf91..ee14eaed 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/ChangePassword/ChangePasswordEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/ChangePassword/ChangePasswordEndpoint.cs @@ -49,7 +49,7 @@ public class ChangePasswordEndpoint : BaseEndpointCancellation token that can be used to stop the execution. public override async Task ExecuteAsync(ChangePasswordRequest request, CancellationToken cancellationToken) { - // assign the currently logged in user as the user for which to change the password + // Assign the currently logged in user as the user for which to change the password. ChangePasswordRequest changePasswordRequest = request with { Username = User?.Identity?.Name }; ChangePasswordResponse response = await _apiHttpClient.PostAsync(ApiRoutes.Authentication.CHANGE_PASSWORD, changePasswordRequest, cancellationToken).ConfigureAwait(false); return JsonSuccess(response); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Login/LoginEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Login/LoginEndpoint.cs index 936620e7..404582fc 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Login/LoginEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Login/LoginEndpoint.cs @@ -67,9 +67,9 @@ public class LoginEndpoint : BaseEndpoint { try { - // attempt API login + // Attempt API login. LoginResponse response = await _apiHttpClient.PostAsync(ApiRoutes.Authentication.LOGIN_ACCOUNT, request, cancellationToken).ConfigureAwait(false); - // store the received token in a secure cookie + // Store the received token in a secure cookie. HttpContext.Response.Cookies.Delete("Token"); HttpContext.Response.Cookies.Append("Token", _cryptographyService.Encrypt(response.Token!), new CookieOptions { @@ -80,7 +80,7 @@ public class LoginEndpoint : BaseEndpoint IsEssential = true, SameSite = SameSiteMode.Strict }); - // tell asp.net we are logged in + // Tell ASP.NET we are logged in. List claims = [ new Claim(ClaimTypes.Name, response.Username!), @@ -89,34 +89,34 @@ public class LoginEndpoint : BaseEndpoint ]; ClaimsIdentity claimsIdentity = new(claims, CookieAuthenticationDefaults.AuthenticationScheme); await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(claimsIdentity)).ConfigureAwait(false); - // get current culture from route data or use default if not set + // Get current culture from route data or use default if not set. string currentCulture = Culture; - // handle ReturnUrl and ensure it includes the correct culture + // Handle ReturnUrl and ensure it includes the correct culture. string redirectUrl; if (!string.IsNullOrEmpty(request.ReturnUrl) && IsLocalUrl(request.ReturnUrl)) // ensure that return URL contains the correct culture redirectUrl = request.ReturnUrl.StartsWith($"/{currentCulture}/") ? request.ReturnUrl : $"/{currentCulture}{request.ReturnUrl}"; else { - // if no ReturnUrl is provided or it's invalid, use a default URL with respect to base paths + // If no ReturnUrl is provided or it's invalid, use a default URL with respect to base paths. redirectUrl = "/"; - // handle reverse proxy scenarios by respecting any base path or forwarded headers + // Handle reverse proxy scenarios by respecting any base path or forwarded headers. if (HttpContext.Request.Headers.TryGetValue("X-Forwarded-Prefix", out Microsoft.Extensions.Primitives.StringValues pathBase)) redirectUrl = pathBase + redirectUrl; - // ensure that default redirect contains the correct culture + // Ensure that default redirect contains the correct culture. if (!redirectUrl.StartsWith($"/{currentCulture}/")) redirectUrl = $"/{currentCulture}{redirectUrl}"; } - // return success status and redirect URL + // Return success status and redirect URL. return JsonSuccess(redirectUrl); } catch (ApiException apiException) { - // in this particular case, we DO NOT want to let the exception handling middleware take care of this exception, because when the user has 2FA enabled, the first auth step involves sending + // In this particular case, we DO NOT want to let the exception handling middleware take care of this exception, because when the user has 2FA enabled, the first auth step involves sending // only the username and password, in which case the server API will respond with a validation error, that TOTP code is not valid (empty); it is then that we catch this error here - // and display the form that asks the user for the TOTP code + // and display the form that asks the user for the TOTP code. if (apiException.ProblemDetails is not null && apiException.ProblemDetails.Extensions?.Count > 0 && apiException.ProblemDetails.Extensions.TryGetValue("errors", out JsonElement errorsObj)) if (errorsObj is JsonElement jsonElement && jsonElement.ValueKind == JsonValueKind.Object) foreach (JsonProperty error in jsonElement.EnumerateObject()) diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Login/LoginViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Login/LoginViewEndpoint.cs index 4a758ef8..dcb51bd0 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Login/LoginViewEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Login/LoginViewEndpoint.cs @@ -54,10 +54,10 @@ public class LoginViewEndpoint : BaseEndpoint public override Task ExecuteAsync(LoginViewRequest request, CancellationToken cancellationToken) { Dictionary viewData = new() { ["ReturnUrl"] = request.ReturnUrl }; - // if the user is already logged in, redirect them to the home page + // If the user is already logged in, redirect them to the home page. if (User?.Identity?.IsAuthenticated == true) return Task.FromResult(Results.Redirect(_urlService.GetAbsoluteUrl(WebRoutes.Home.INDEX_CULTURED)!)); - // check if the application is initialized (does contain at least the super user account); if it's not, redirect to registration view + // Check if the application is initialized (does contain at least the super user account); if it's not, redirect to registration view. string? isPendingSuperAdminSetup = HttpContext.Session.GetString(HttpContextItemKeys.PENDING_SUPER_ADMIN_SETUP); if (isPendingSuperAdminSetup == "true") return Task.FromResult(Results.Redirect(_urlService.GetAbsoluteUrl(WebRoutes.Authentication.REGISTER_VIEW)!)); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Logout/LogoutEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Logout/LogoutEndpoint.cs index b6dae3b9..09d735c8 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Logout/LogoutEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Logout/LogoutEndpoint.cs @@ -48,7 +48,7 @@ public class LogoutEndpoint : BaseEndpoint /// Cancellation token that can be used to stop the execution. public override async Task ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken) { - // if the user is not logged in, redirect them to the home page + // If the user is not logged in, redirect them to the home page. if (User?.Identity?.IsAuthenticated == false) return Results.Redirect(_urlService.GetAbsoluteUrl(WebRoutes.Home.INDEX_CULTURED)!); HttpContext.Response.Cookies.Delete("Token"); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/RecoverPassword/RecoverPasswordViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/RecoverPassword/RecoverPasswordViewEndpoint.cs index cf3a319a..8efd51b9 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/RecoverPassword/RecoverPasswordViewEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/RecoverPassword/RecoverPasswordViewEndpoint.cs @@ -50,7 +50,7 @@ public class RecoverPasswordViewEndpoint : BaseEndpoint /// Cancellation token that can be used to stop the execution. public override Task ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken) { - // if the user is already logged in, redirect them to the home page + // If the user is already logged in, redirect them to the home page. if (User?.Identity?.IsAuthenticated == true) return Task.FromResult(Results.Redirect(_urlService.GetAbsoluteUrl(WebRoutes.Home.INDEX_CULTURED)!)); RecoverPasswordRequest recoverPasswordRequest = new(Username: null, TotpCode: null); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Register/RegisterEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Register/RegisterEndpoint.cs index 7c7244ca..c7e52761 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Register/RegisterEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Register/RegisterEndpoint.cs @@ -50,9 +50,9 @@ public class RegisterEndpoint : BaseEndpoint /// Cancellation token that can be used to stop the execution. public override async Task ExecuteAsync(RegisterRequest request, CancellationToken cancellationToken) { - // call different endpoints based on the view hidden field - registration for normal users, or initial application admin account setup + // Call different endpoints based on the view hidden field - registration for normal users, or initial application admin account setup. string endpoint = request.RegistrationType == "Admin" ? ApiRoutes.Initialization.SETUP_APPLICATION : ApiRoutes.Authentication.REGISTER_ACCOUNT; - // attempt API registration + // Attempt API registration. RegisterResponse response = await _apiHttpClient.PostAsync(endpoint, request, cancellationToken).ConfigureAwait(false); return JsonSuccess(response); } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Register/RegisterViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Register/RegisterViewEndpoint.cs index 3dd37c77..34b0766f 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Register/RegisterViewEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/UsersManagement/Authentication/Register/RegisterViewEndpoint.cs @@ -40,7 +40,7 @@ public class RegisterViewEndpoint : BaseEndpoint /// Cancellation token that can be used to stop the execution. public override Task ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken) { - // check if this is the initial super admin setup + // Check if this is the initial super admin setup. string? isPendingSuperAdminSetup = HttpContext.Session.GetString(HttpContextItemKeys.PENDING_SUPER_ADMIN_SETUP); string registrationType = isPendingSuperAdminSetup == "true" ? "Admin" : "User"; Dictionary viewData = new() { ["RegistrationType"] = registrationType };