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.