• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
std

std

oauth

Login with Val Town OAuth Middleware
Unlisted
Like
1
oauth
Home
Code
7
README.md
TESTING.md
crypto.ts
H
example.tsx
middleware.ts
oauth.ts
session.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
TESTING.md
Code
/
TESTING.md
Search
10/29/2025
Viewing readonly version of main branch: v159
View latest version
TESTING.md

OAuth Testing Guide

Test the @std/oauth library using Playwright MCP tools.

Prerequisites

  • Val Town MCP server access
  • Playwright MCP tools (mcp__playwright__*)

Test Flow

1. Navigate to demo app

mcp__playwright__browser_navigate({ url: "https://std--91178458b42e11f0b6f30224a6c84d84.web.val.run" });

2. Click "Log in"

mcp__playwright__browser_click({ element: "Log in link", ref: "e5" });

Expected: Redirects to Val Town OAuth authorization page

3. Click "Allow"

mcp__playwright__browser_click({ element: "Allow button", ref: "e18" });

Expected: Redirects back to app, shows "Logged in as: [username]"

4. Verify session

Navigate to home page again - should still be logged in.

5. Test logout

mcp__playwright__browser_click({ element: "Log out link", ref: "e6" });

Expected: Returns to logged out state

What Works

  • OAuth authorization flow
  • Session cookie creation
  • User data from ID token
  • Encrypted sessions
  • Logout

Notes

  • Sessions last 30 days
  • User data stored in encrypted cookie
  • No database required
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.