auth-work

Implement Wix member authentication with useMembers and protected routes.

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/arborba100/Domcomando --skill auth-work-arborba100
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-work
Source: https://github.com/arborba100/Domcomando/tree/main/.emdash/skills/auth-work
Command: npx skills add https://github.com/arborba100/Domcomando --skill auth-work-arborba100

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Authentication and member features are essential for secure apps; this skill provides patterns to manage login, logout, and protected content using Wix Member Features, avoiding bespoke auth implementations.

Core Features & Use Cases

  • Use the useMembers hook from @wix/member-features to access the currently authenticated member and their profile.
  • Protect pages and routes with a simple pattern (e.g., a ProtectedRoute or MemberProtectedRoute) to require authentication.
  • Redirect unauthenticated users to the login page (and preserve a return URL) to resume work after signing in.
  • Build conditional UI based on authentication state to show or hide member-only content and menus.
  • Leverage a standardized Login Page at /login and reuse a prebuilt account-management flow for consistency across the app.

Quick Start

Create a single login route at /login and guard protected pages using the useMembers hook and a simple route wrapper.

Frequently Asked Questions about auth-work

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement protected routes for Wix members in a React app?

Use the useMembers hook from @wix/member-features to access the authenticated member's profile and conditionally render member-only UI elements. This allows you to display user menus and hide content based on login state.

How do I redirect unauthenticated users to login and return them to their original page?

Redirect unauthenticated users to the /login route while preserving their original URL as a return parameter. After successful Wix member authentication, redirect them back to resume their previous activity.

Do I need to build a custom authentication flow to use Wix member features?

No, you do not need to build a custom authentication flow. This pattern leverages Wix Member Features and the useMembers hook to manage login, logout, and protected content natively without bespoke implementations.

How do I show conditional UI based on Wix member authentication state?

Use the useMembers hook from @wix/member-features to access the authenticated member's profile and conditionally render member-only UI elements. This allows you to display user menus and hide content based on login state.

Can I use React Router with Wix member authentication to guard multiple pages?

Yes, you can use React Router with Wix member authentication by applying a reusable MemberProtectedRoute wrapper across multiple protected pages, ensuring consistent access control without repeating logic.