Merge branch 'auth-system' into back-office-integration
This commit is contained in:
@@ -2,7 +2,7 @@ import { Component, computed, ChangeDetectionStrategy, signal, OnDestroy, inject
|
||||
import { DecimalPipe } from '@angular/common';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { CartService, ApiService, LanguageService } from '../../services';
|
||||
import { CartService, ApiService, LanguageService, AuthService } from '../../services';
|
||||
import { Item, CartItem } from '../../models';
|
||||
import { interval, Subscription } from 'rxjs';
|
||||
import { switchMap, take } from 'rxjs/operators';
|
||||
@@ -28,6 +28,7 @@ export class CartComponent implements OnDestroy {
|
||||
isnovo = environment.theme === 'novo';
|
||||
|
||||
private i18n = inject(TranslateService);
|
||||
private authService = inject(AuthService);
|
||||
|
||||
// Swipe state
|
||||
swipedItemId = signal<number | null>(null);
|
||||
@@ -135,6 +136,11 @@ export class CartComponent implements OnDestroy {
|
||||
alert(this.i18n.t('cart.acceptTerms'));
|
||||
return;
|
||||
}
|
||||
// Auth gate: require Telegram login before payment
|
||||
if (!this.authService.isAuthenticated()) {
|
||||
this.authService.requestLogin();
|
||||
return;
|
||||
}
|
||||
this.openPaymentPopup();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user