skills/vendix-customer-auth/SKILL.md
Customer authentication patterns for STORE_ECOMMERCE using modal login/register, store-scoped auth endpoints, tenant context, and legal document acceptance. Trigger: When implementing customer login, registration, auth modal, or ecommerce auth flows.
npx skillsauth add rzyfront/vendix vendix-customer-authInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
STORE_ECOMMERCE.loginCustomer, registerCustomer, customer tokens, or legal document acceptance.POST /auth/register-customer is @Public().POST /auth/login-customer is @Public().ip_address and user_agent from the request.Files:
apps/backend/src/domains/auth/auth.controller.tsapps/backend/src/domains/auth/auth.service.tsapps/backend/src/domains/auth/dto/register-customer.dto.tsapps/backend/src/domains/auth/dto/login-customer.dto.tsRegisterCustomerDto requires email, first_name, last_name, and store_id.
password is optional in the backend DTO. If provided, it must be at least 8 chars and contain at least one non-alphanumeric character. The current frontend modal requires a password during registration.
Optional registration fields include phone, document_type, and document_number. Phone allows digits plus + # * ( ) - and spaces.
LoginCustomerDto requires email, password, and store_id.
registerCustomer():
store_id.customer in lowercase.users with the store organization id.user_settings with app_type: 'STORE_ECOMMERCE'.user_roles and store_users association.customer.created and sends a store-branded welcome email.loginCustomer():
email + organization_id.customer and association in store_users.store_id: store.id.updatedEnvironment: 'STORE_ECOMMERCE'.Use modal auth, not redirects, for customer login/register.
Files:
apps/frontend/src/app/private/layouts/store-ecommerce/store-ecommerce-layout.component.tsapps/frontend/src/app/private/layouts/store-ecommerce/components/auth-modal/auth-modal.component.tsapps/frontend/src/app/core/store/auth/auth.actions.tsapps/frontend/src/app/core/store/auth/auth.facade.tsapps/frontend/src/app/core/store/auth/auth.effects.tsapps/frontend/src/app/core/store/auth/auth.reducer.tsThe layout uses signals:
readonly is_auth_modal_open = signal(false);
readonly auth_modal_mode = signal<'login' | 'register'>('login');
login(): void {
this.auth_modal_mode.set('login');
this.is_auth_modal_open.set(true);
}
Template binding:
<app-auth-modal
[isOpen]="is_auth_modal_open()"
[initialMode]="auth_modal_mode()"
[storeLogo]="store_logo()"
[storeName]="store_name()"
(closed)="closeAuthModal()"
/>
AuthModalComponent uses signal input()/output() APIs and signal state. It auto-closes with an effect() when authFacade.isAuthenticated() becomes true while the modal is open.
Login calls:
const storeId = this.tenantFacade.getCurrentStoreId();
this.authFacade.loginCustomer(email, password, storeId);
Registration calls:
this.authFacade.registerCustomer({
email,
password,
first_name,
last_name,
store_id: storeId,
});
The modal requires pending legal documents to be accepted before registration when any are returned by the legal service.
Dedicated customer actions exist: loginCustomer, loginCustomerSuccess, loginCustomerFailure, registerCustomer, registerCustomerSuccess, and registerCustomerFailure.
AuthFacade.loginCustomer() and AuthFacade.registerCustomer() dispatch those actions. Facade signals use toSignal(..., { initialValue }).
loginSuccess$ handles customer login success too. Customer login returns updatedEnvironment: 'STORE_ECOMMERCE'; do not rely on it being null.
registerCustomerSuccess persists auth state in the reducer and shows a success toast through its effect.
The auth modal obtains store_id through TenantFacade.getCurrentStoreId(), which reads currentStore().id first and falls back to domainConfig().store_id.
Legal document APIs use x-store-id and live in apps/frontend/src/app/public/ecommerce/services/legal.service.ts.
loginCustomer/registerCustomer, not admin login/register, for ecommerce customers.customer when reasoning about backend role names.vendix-ecommerce-checkout - Guest vs authenticated checkout boundaryvendix-backend-auth - Backend auth guards and public routesvendix-zoneless-signals - Modal signal patternsvendix-multi-tenant-context - Store id resolutiondevelopment
Mobile app development rules for Vendix Expo/React Native project. Trigger: When editing, creating, or modifying any file under apps/mobile, or when developing mobile-specific features.
development
Feature gating by store subscription state: global store write guard, AI feature gate, Redis feature resolution, quota consumption, frontend paywall interceptor, banner, and subscription UI states. Trigger: When adding feature gates, paywalls, subscription-based access control, protecting store write operations, AI feature gates, or rollout flags.
testing
SaaS subscription billing for Vendix stores: plan pricing, invoices, Wompi platform payments, manual payments, partner commissions, payouts, proration, and dunning. Trigger: When creating SaaS invoices, working with partner rev-share, margin/surcharge pricing, invoice sequence allocation, partner payout batches, subscription payments, manual payments, or dunning flows.
development
Periodic quota counters with Redis, UTC period keys, Lua-based idempotent AI quota consumption, request-id deduplication, and post-success consumption. Trigger: When building quota counters, enforcing monthly/daily feature caps, or reusing AI quota patterns for uploads, emails, exports, or rate-limited features.