Build a members-only SaaS with real auth flows: email verification, password reset, GitHub and Google sign-in CloudHike published week 5 of its "Build with CloudHike" series, a tutorial for building a members-only Next.js SaaS app called members-club with email verification, password reset, and GitHub and Google sign-in using CloudHike Auth deployed over MCP. The tutorial uses CloudHike's shared OAuth app so developers register no OAuth apps of their own, sends verification and reset emails through CloudHike's own sender with no SMTP setup, and stores sessions in HTTP-only cookies restricted to listed return sites. CloudHike's Free plan allows 2 projects and up to 10,000 registered auth users per project, and new accounts receive $10 in free credits, plus $5 with the code TUBEGURUJI5, valid for 90 days with no card required. Build a members-only SaaS with real auth flows: email verification, password reset, GitHub and Google sign-in This is week 5 of Build with CloudHike, a weekly series where we build a small, real-world app with an AI coding agent and let CloudHike handle the backend. New here? Week 1 built a referral waitlist, week 2 moved slow AI work into background jobs, week 3 built a file-sharing app with presigned uplo ads, and week 4 connected every major AI editor to one project. Each post stands on its own, so you can start right here. Week 1 used Auth for exactly one person: you, on an admin page. That's the easy case. The moment strangers can sign up, "login" turns into a list: confirm the email is real, let people reset a forgotten password, offer "Continue with GitHub" because nobody wants another password, keep the session token away from page scripts, and make sure every email link and OAuth redirect lands back on your site and nowhere else. Usually that list means an auth library, an SMTP provider, and two OAuth apps registered in two developer consoles. This week your agent deploys CloudHike Auth over MCP, you flip a few switches on the Auth page, and you build all of it with copy-paste prompts. Every endpoint, header and setting below comes from the live Auth docs and MCP docs. A Next.js app called members-club with a private /members area: Email and password sign-up that requires a verified email before the first sign-in A "resend verification email" button for people who lost the first one Forgot password: a reset link by email, and a page to set a new password Continue with GitHub and Continue with Google, using CloudHike's shared OAuth app no OAuth app of your own to register HTTP-only cookie sessions: the token lives in a cookie your server sets, and server code checks it on every request Sites users can return to: every verification link, reset link and OAuth redirect only goes back to sites you listed An optional /admin page that lists members with the server-only secret key Here's how it maps to CloudHike, all in one project: Postgres 16 DATABASE URL . Deployed first, so Auth keeps its users in the project's own database, in the auth schema Auth AUTH URL, AUTH PUBLISHABLE KEY, AUTH SECRET KEY . A plain HTTP API for sign-up, sign-in, sessions, verification, resets and social sign-in Verification and reset emails sent by CloudHike's own sender, so there's no SMTP to configure A CloudHike account. Every new account gets $10 in free credits eligible accounts, once per inbox, valid for 90 days , plus an extra $5 with the code TUBEGURUJI5, and no card is needed. The Free plan allows 2 projects and up to 10,000 registered auth users per project, which is plenty for this. Cursor or Claude Code Codex, VS Code, Windsurf and Gemini CLI work too; see week 4 . Node.js, for a Next.js app. A GitHub and/or Google account to test social sign-in, and an inbox you can read for the verification and reset emails. In the CloudHike dashboard, open Connect MCP in the sidebar https://cloudhike.dev/dashboard/coding-agent , pick your editor and click Copy with key. That creates your workspace API key the first time and gives you a snippet with the key already filled in. The server is remote Streamable HTTP , so there's nothing to install. Claude Code claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \ --header "Authorization: Bearer icu your api key" Run /mcp inside Claude Code to check that it's connected. Cursor ~/.cursor/mcp.json { "mcpServers": { "cloudhike": { "url": "https://cloudhike.dev/api/mcp", "headers": { "Authorization": "Bearer icu your api key" } } } } Open Cursor Settings β†’ MCP and look for the green dot. Snippets for Codex, VS Code, Windsurf, Gemini CLI and Claude Desktop are in the MCP docs. Treat the key like a password: keep it in your home folder, not the repo. Revoke on the Connect MCP page disconnects every editor at once. npx create-next-app@latest members-club cd members-club Open the folder in Cursor, or run claude in it. Paste: Use the cloudhike MCP tools to set up the backend for this app. It's a members-only Next.js app: people sign up, verify their email, and then see a private /members area. Create a CloudHike project called "members-club". Deploy postgres first and wait until it's ready, then deploy auth and wait again, so Auth keeps its users in the project's Postgres. Put the .env into .env.local, make sure it's git-ignored, and don't show me any secret values. Then call get docs for "auth" and summarise the endpoints and headers it describes. Don't write app code yet. Tell me which services are running and which variable names are in .env.local. Behind the scenes that's create project, deploy services twice , wait for services, get environment written straight into .env.local, and get docs for the Auth page as Markdown. You should end up with DATABASE URL, AUTH URL, AUTH PUBLISHABLE KEY and AUTH SECRET KEY. What those three Auth values are for, straight from the docs: AUTH URL: the base address of your project's auth API. Safe in browser code. AUTH PUBLISHABLE KEY: identifies your project, sent as the x-api-key header on every request. Safe in browser code. AUTH SECRET KEY: unlocks the admin endpoints. Server only. Never ship it to a browser or mobile app. Provider and email settings live on the Auth page, not in MCP. Open the project, then Open Auth on the Auth card: Providers tab β†’ Require a verified email before sign-in. Turn it on. Sign-up now sends a verification link, and sign-in returns 403 until the user opens it. Sites users can return to. Add each site your app runs on, one per line: your local dev address now, your production domain later. Verification links, reset links and social sign-in only ever send users back to these sites. Sign in with GitHub or Google. For each provider, pick the credential source Shared, which uses CloudHike's own OAuth app. Later you can switch to Your own and paste the client ID and secret of an OAuth app you registered, with the callback URL shown on the card