@exposify/next 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -152,6 +152,42 @@ was found. Name another one with `aiReady(exposify, { login: "signIn" })`
152
152
  (an action's export name) or `{ login: { path: "/api/login", fields:
153
153
  ["email", "password"] } }`, or turn it off with `login: false`.
154
154
 
155
+ **Logins in two steps.** If your login asks for a code next (two-factor:
156
+ it sets a pending cookie and redirects to a code page, or answers
157
+ `{ mfaRequired: true }`), the form asks for the code too and runs your second
158
+ step (a Server Action or route named like `verify`, `2fa` or `otp` that takes
159
+ one code and sets the session) with the cookies the first step set. The
160
+ password isn't kept between the two forms. Passwordless logins work the same
161
+ way: an email or phone number, then a code, with "Send a new code". Name the
162
+ second step with `loginVerify: "verifyCode"` (or `{ path, fields }`), or turn
163
+ it off with `loginVerify: false`. Magic links aren't supported; an email that
164
+ also carries a code is.
165
+
166
+ **Supabase Auth (`@supabase/ssr`).** The generator looks for Supabase, not
167
+ for a login form: it finds your `signInWithPassword`, `signInWithOtp`,
168
+ `signInWithOAuth` and `<Auth />` calls and whether each runs in the browser
169
+ or on your server.
170
+
171
+ - Signed in from the browser (as in Supabase's own starter), or nowhere it
172
+ could find: AI assistants sign in to your Supabase project directly. A
173
+ password goes on the form at `/mcp/login`, from your app's server straight
174
+ to Supabase; social logins and email codes go through Supabase on
175
+ Exposify's page; a user with an authenticator app enters its code too.
176
+ - Signed in from a Server Action or route handler: that's your login, and
177
+ the form runs it, since it may check more than Supabase does. Social
178
+ logins still go to Supabase directly.
179
+
180
+ Either way, tool calls carry the `sb-<ref>-auth-token` cookie your server
181
+ reads, and Exposify refreshes the session before supabase-js would. The
182
+ route reads `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY`
183
+ (or `_ANON_KEY`); pass `aiReady(exposify, { supabase: { url, key } })` to
184
+ name them, or `supabase: false` to turn it off. The dashboard shows what was
185
+ found and has the switch for passwords. `inspect` says which way it went and
186
+ why; `npx @exposify/next test-sign-in` signs in on your running app and checks
187
+ a protected page accepts the cookie. `@supabase/auth-helpers-nextjs` (an
188
+ older cookie format) isn't supported, and apps on `@supabase/supabase-js`
189
+ alone keep their session in the browser, where the server never sees it.
190
+
155
191
  **No login found, and no sign-in method in the dashboard?** Then agents use
156
192
  your app signed out: `/mcp` doesn't ask them to sign in, and your own checks
157
193
  decide what they can do. The startup log says which it is