feat: hide product prices from unauthenticated (guest) users
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m48s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m48s
Guests can browse products and product details for presentation purposes, but prices are hidden behind a 'وارد شوید' prompt (lock icon). Authenticated users see prices as before. Affected pages: - Landing page (Index): top-selling regular + discount sections - Store/Products list - Store/ProductDetail (desktop price + mobile sticky bar) - DiscountStore/Products list - DiscountStore/ProductDetail (full price box) Each code-behind now checks AuthService.IsAuthenticatedAsync() on init and stores the result in _isAuthenticated for use in the template. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,6 +11,9 @@ public partial class ProductDetail
|
||||
[Inject] private DiscountCartService DiscountCartService { get; set; } = default!;
|
||||
[Inject] private VATService VAT { get; set; } = default!;
|
||||
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
||||
[Inject] private AuthService AuthService { get; set; } = default!;
|
||||
|
||||
private bool _isAuthenticated;
|
||||
|
||||
private DiscountProductDetail? _product;
|
||||
private string _selectedImage = string.Empty;
|
||||
@@ -20,6 +23,7 @@ public partial class ProductDetail
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_isAuthenticated = await AuthService.IsAuthenticatedAsync();
|
||||
await LoadProductAsync();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user