Setting the file. One moment.
Subchapter 7.71
references/members/INSTRUCTIONS.mdMarkdown4 KBView on GitHub
The Members vertical ships a custom credential login, not the Wix-hosted
login-page redirect. Members sign up and sign in on /login with email and
password; the shipped client exchanges a direct-login session into member
tokens into the managed wixSession cookie. That makes the member identity
available to both the custom client and Astro’s ambient SDK calls after the
next navigation. Do not replace the auth implementation or add a second client.
| File | Purpose |
|---|---|
wix/members/client.ts | Explicit OAuthStrategy client that syncs direct-login tokens to Astro. |
wix/members/auth.ts | Direct register, login, verification, and logout state machine. |
wix/members/member-store.ts + hooks/members/useMember.ts | Module-scoped session state shared by Astro islands. |
components/members/LoginForm.tsx | Branded in-app sign-in/sign-up and verification UI. |
components/members/MemberMenu.tsx, RequireAuth.tsx, AccountView.tsx | Header control, client gate, and account surface references. |
pages/login.astro, pages/account.astro | Custom-login and gated-account routes. |
<MemberMenu client:only="react" /> in the winning site header./login route. It is the only login surface; never link to
/api/auth/login, build an OAuth callback page, or redirect to Wix login./account client-gated with <RequireAuth>. A visitor sees a link to
/login; a member sees their actual profile.login(email, password) and register(email, password, profile) return all
Wix states: SUCCESS, EMAIL_VERIFICATION_REQUIRED,
OWNER_APPROVAL_REQUIRED, or FAILURE. The shipped form handles each one.getMemberTokensForDirectLogin then setTokens on
the same client. It writes Astro’s wixSession cookie, so the next page
request and browser islands run later SDK calls as that member.WIX_MEMBERS_CLIENT_ID by deploy,
even for managed Astro. It is public; never add an OAuth secret to the app./api/auth/login, OAuth callback, or callback URI
requirement for credential login.auth.elevate() for a member reading their own records./login renders an in-app email/password sign-in and sign-up form./account without a
Wix-hosted login redirect.