new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Better Auth · Plugins · all subjects

test-utils/auth-helpers

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

login helper creates authenticated session

The test.login({ userId }) helper creates a session for a user and returns an object containing: session (the session object with userId and token), user (the user object), headers (Headers object with session cookie for fetch/Request), cookies (cookie array for Playwright/Puppeteer), and token (the session token string).

getAuthHeaders returns Headers with session cookie

The test.getAuthHeaders({ userId }) helper returns a Headers object with the session cookie set. It is useful for making authenticated requests with fetch or auth API methods.

getCookies returns browser-compatible cookie objects

The test.getCookies({ userId, domain }) helper returns an array of cookie objects compatible with browser testing tools like Playwright and Puppeteer. The domain parameter is optional and defaults to the baseURL domain. Each cookie object contains: name (cookie name, e.g. 'better-auth.session_token'), value (cookie value), domain (cookie domain), path (defaults to '/'), httpOnly (whether cookie is HTTP-only), secure (whether cookie requires HTTPS), and sameSite (SameSite attribute: 'Lax', 'Strict', or 'None').

Give your agent this brain