Refactored `LoginSenderPage.razor` to introduce a modern layout, dynamic branding support, and enhanced validation. Updated localization files (`de-DE`, `en-US`, `fr-FR`) with new keys for improved messaging. Added client-side validation for required fields and error handling for invalid credentials. Enabled anonymous access to `CustomImagesController` for displaying branding before authentication. Updated CSS for consistent theming and responsive design. Cleaned up redundant code and improved maintainability. Footer now dynamically displays the current year and company name.
29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Options;
|
|
using EnvelopeGenerator.Domain.Constants;
|
|
using EnvelopeGenerator.Server.Models;
|
|
|
|
namespace EnvelopeGenerator.Server.Controllers;
|
|
|
|
/// <summary>
|
|
/// Exposes the CustomImages configuration (signFLOW logo + company logo) to WASM clients.
|
|
/// Values are sourced from appsettings.json "CustomImages" section via Options Pattern.
|
|
///
|
|
/// To change logos per deployment: update "CustomImages.App.Src", "App.Height",
|
|
/// "Company.Src", "Company.Height" in appsettings.json — no code change required.
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route("api/[controller]")]
|
|
[Authorize(Policy = AuthPolicy.SenderOrReceiver)]
|
|
public class CustomImagesController(IOptions<CustomImagesOptions> options) : ControllerBase
|
|
{
|
|
/// <summary>
|
|
/// Returns the signFLOW app logo and company logo configuration.
|
|
/// Anonymous access allowed so the login page can display branding before the user authenticates.
|
|
/// </summary>
|
|
[HttpGet]
|
|
[AllowAnonymous]
|
|
public ActionResult<CustomImagesOptions> Get() => Ok(options.Value);
|
|
}
|