其他

oauth

vercel-labs/portless

Configure OAuth providers (Google, Apple, Microsoft, Facebook, GitHub, etc.) to work with portless local dev URLs. Use when setting up OAuth redirect URIs, fixing "redirect_uri_mismatch" or "invalid redirect" errors, configuring sign-in providers for local development, or when a provider rejects .localhost subdomains. Triggers include "OAuth not working with portless", "redirect URI mismatch", "Google/Apple/Microsoft sign-in fails locally", "configure OAuth for local dev", or any task involving OAuth callback URLs with portless domains.

  • 3025 次安装
  • 1.3万 星标
  • 收录于

安装命令

npx skills add https://github.com/vercel-labs/portless --skill oauth

SKILL.md

OAuth with Portless

OAuth providers validate redirect URIs against domain rules. .localhost subdomains fail on most providers because they are not in the Public Suffix List or are explicitly blocked. Portless fixes this with --tld to serve apps on real, valid domains.

The Problem

When portless uses the default .localhost TLD, OAuth providers reject redirect URIs like http://myapp.localhost:1355/callback:

Provider localhost .localhost subdomains Reason
Google Allowed Rejected Not in their bundled PSL
Apple Rejected Rejected No localhost at all
Microsoft Allowed Allowed Permissive localhost handling
Facebook Allowed Varies Must register each URI exactly
GitHub Allowed Allowed Permissive

Google and Apple are the strictest. Microsoft and GitHub are more lenient with localhost.

The Fix