webdev-manus-oauth

Implements Manus OAuth redirect URL handling with nonce-based CSRF protection for fullstack web projects.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/AnderHonorato/Mem-rias-IA---Infinity --skill webdev-manus-oauth-anderhonorato
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webdev-manus-oauth
Source: https://github.com/AnderHonorato/Mem-rias-IA---Infinity/tree/main/Manus/Skills/webdev-manus-oauth
Command: npx skills add https://github.com/AnderHonorato/Mem-rias-IA---Infinity --skill webdev-manus-oauth-anderhonorato

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manus fullstack (web-db-user) projects deploy the frontend and backend on separate servers, so the backend cannot reliably determine the frontend's origin. Hardcoding domains or using req.host produces broken OAuth callbacks, invite links, and magic links, and a naive state parameter opens an OAuth login CSRF / session-fixation hole. ## Core Features & Use Cases - Origin-safe redirect URLs: Always derive callback and invite URLs from window.location.origin passed explicitly from the frontend, never from hardcoded domains or environment variables. - CSRF-protected OAuth flow: Bind the OAuth state parameter to the browser with a one-time nonce stored in a __Host- prefixed cookie, verified before exchanging the authorization code. - Invite and magic link generation: Pass the frontend origin through tRPC mutations so the backend can build correct invitation, email verification, and magic link URLs. - Use Case: When adding a login button or an event invitation feature to a Manus webdev project, use this Skill to wire the OAuth callback and invite URL generation correctly without introducing session-fixation vulnerabilities. ## Quick Start Ask the AI to implement the Manus OAuth login flow and invite link generation in your webdev project using window.location.origin and the nonce-based state cookie pattern.

Frequently Asked Questions about webdev-manus-oauth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle OAuth redirect URLs in a Manus webdev project?

Always use window.location.origin on the frontend and pass it explicitly to the backend. Never hardcode domains, guess URLs from the app ID, or use req.host, because the frontend and backend are deployed on separate servers.

How do I prevent OAuth login CSRF in a Manus app?

Bind the state parameter to the browser with a one-time nonce stored in a __Host- prefixed cookie, then compare both copies before exchanging the authorization code. The template's encodeOAuthState and decodeOAuthState helpers in @shared/const implement this flow.

Why does Manus OAuth fail in Safari Private Browsing or Brave?

Manus OAuth requires cookies to maintain session state, so it fails in browsers that block all cookies. Unsupported environments include Safari Private Browsing, Firefox with strict Enhanced Tracking Protection, and Brave with aggressive Shields.

How do I generate invite or magic link URLs from the backend?

Have the frontend pass its origin in the request, for example as an origin field in a tRPC mutation validated with z.string().url(). The backend then builds the invite URL from that origin instead of guessing the domain.

Why does my OAuth callback return 403 after login?

A 403 means the state nonce did not match the cookie set at login start. Common causes are minting the nonce on every render instead of only when navigating to the login URL, or a cookie-blocked context such as a plain-HTTP non-localhost address.