smithery/rzyfront

vendix-customer-auth

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.

Installation

$ npx skills add smithery/rzyfront --skill vendix-customer-auth

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/rzyfront · top by installs.

npx skills add smithery/rzyfront

Browse all from smithery/rzyfront

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.1
LicenseMIT
More metadata
author
rzyfront
version
1.1
scope
["root"]
auto_invoke
["Implementing customer auth in e-commerce","Creating auth modal components","Customer registration flow"]

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 5,785 B
  • docs SUMMARY.md 213 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

When to Use

  • Implementing customer login or registration in STORE_ECOMMERCE.
  • Editing the ecommerce auth modal or store ecommerce layout.
  • Working with loginCustomer, registerCustomer, customer tokens, or legal document acceptance.

Backend Endpoints

  • POST /auth/register-customer is @Public().
  • POST /auth/login-customer is @Public().
  • Both collect ipaddress and useragent from the request.

Files:

  • apps/backend/src/domains/auth/auth.controller.ts
  • apps/backend/src/domains/auth/auth.service.ts
  • apps/backend/src/domains/auth/dto/register-customer.dto.ts
  • apps/backend/src/domains/auth/dto/login-customer.dto.ts

DTO Rules

RegisterCustomerDto requires email, firstname, lastname, 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, documenttype, and documentnumber. Phone allows digits plus + # * ( ) - and spaces.

LoginCustomerDto requires email, password, and store_id.

Backend Service Behavior

registerCustomer():

  • Finds the store by store_id.
  • Rejects duplicate email within the store organization.
  • Uses role name customer in lowercase.
  • Generates a temporary password if backend password is omitted.
  • Creates users with the store organization id.
  • Creates usersettings with apptype: 'STORE_ECOMMERCE'.
  • Creates userroles and storeusers association.
  • Generates tokens with organization context.
  • Emits customer.created and sends a store-branded welcome email.

loginCustomer():

  • Finds store and user by email + organization_id.
  • Validates bcrypt password.
  • Rejects suspended/archived users.
  • Requires role customer and association in store_users.
  • Generates tokens with store_id: store.id.
  • Returns updatedEnvironment: 'STORE_ECOMMERCE'.

Frontend Modal Pattern

Use modal auth, not redirects, for customer login/register.

Files:

  • apps/frontend/src/app/private/layouts/store-ecommerce/store-ecommerce-layout.component.ts
  • apps/frontend/src/app/private/layouts/store-ecommerce/components/auth-modal/auth-modal.component.ts
  • apps/frontend/src/app/core/store/auth/auth.actions.ts
  • apps/frontend/src/app/core/store/auth/auth.facade.ts
  • apps/frontend/src/app/core/store/auth/auth.effects.ts
  • apps/frontend/src/app/core/store/auth/auth.reducer.ts

The 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()"
/>

Auth Modal Behavior

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.

NgRx Auth Pattern

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.

Tenant Context

The auth modal obtains storeid through TenantFacade.getCurrentStoreId(), which reads currentStore().id first and falls back to domainConfig().storeid.

Legal document APIs use x-store-id and live in apps/frontend/src/app/public/ecommerce/services/legal.service.ts.

Rules

  • Use loginCustomer/registerCustomer, not admin login/register, for ecommerce customers.
  • Use signals for modal state; do not copy old plain boolean examples.
  • Use lowercase customer when reasoning about backend role names.
  • Keep frontend password validators aligned with backend password requirements when a password is collected.
  • Do not redirect customers to admin routes after login.
  • Keep document acceptance in the registration flow when pending legal documents exist.

Related Skills

  • vendix-ecommerce-checkout - Guest vs authenticated checkout boundary
  • vendix-backend-auth - Backend auth guards and public routes
  • vendix-zoneless-signals - Modal signal patterns
  • vendix-multi-tenant-context - Store id resolution