DEV Community

Jake Mcdonald
Jake Mcdonald

Posted on Originally published at shipember.com

Google, GitHub, or Magic Links? Picking Auth Providers for a Next.js MVP (Auth.js v5, 2026)

By Jake Mcdonald, founder of ShipEmber · November 19, 2026 · About an 8-minute read · Checked against the Auth.js, GitHub, Google, and Resend docs

I'm Jake Mcdonald. Every time I start a new SaaS, I lose an hour to the same question: which sign-in buttons go on the login page? Google? GitHub? Email magic links? All three? And then I lose another afternoon to callback URL errors and a consent screen I forgot to publish.

This post is how I decide now, for a Next.js App Router app using Auth.js v5 (the next-auth@5 package). Short version: pick one OAuth provider your users already live in, add email magic links as the fallback, and skip passwords. Below is why, plus the setup gotchas for each one. I checked the details against the Auth.js Google, GitHub, and email provider docs, GitHub's OAuth app docs, Google's OAuth docs, and Resend's docs on November 19, 2026.

The short version: what I turn on first

Your users are... Turn on first Add second Skip for now
Developers GitHub Email magic link Passwords
Everyone else (creators, small businesses, consumers) Google Email magic link Passwords
Work accounts on mixed providers Email magic link Google Passwords

Two providers is the sweet spot for an MVP. One is too few, because somebody always wants to avoid the one you picked. Four buttons is a wall of logos, and every provider is another app registration, another secret, and another set of callback URLs to keep in sync across local, Preview, and production.

Why skip passwords? The Credentials provider in Auth.js puts hashing, resets, rate limiting, and breach handling on you, and it requires the JWT session strategy. None of that makes your MVP more likely to get its first paying user.

The one setting that's the same for all of them: callback URLs

Every Auth.js OAuth provider calls back to the same path pattern:

https://your-domain.com/api/auth/callback/google
https://your-domain.com/api/auth/callback/github
Enter fullscreen mode Exit fullscreen mode

Locally that's http://localhost:3000/api/auth/callback/<provider>. Most "it works locally but not in prod" auth bugs I've seen come down to that URL missing from the provider's settings for one environment.

Auth.js v5 also picks up provider credentials from env vars on its own if you use its naming: AUTH_GOOGLE_ID, AUTH_GOOGLE_SECRET, AUTH_GITHUB_ID, AUTH_GITHUB_SECRET. Use those names and you'll write less config.

Google: the default for non-developer audiences

Google is the button most normal people expect. The Auth.js side is short:

// auth.ts
import NextAuth from "next-auth"
import Google from "next-auth/providers/google"

export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [Google],
})
Enter fullscreen mode Exit fullscreen mode

The Google Cloud side is where people get stuck:

  • Testing vs. In production. An External app in "Testing" status is limited to test users you add by hand (up to 100). Google makes an exception when you only ask for the basic openid, email, and profile scopes, which is all a sign-in button needs. Still, publish it before launch so you're not debugging this on launch day.
  • Ask only for sign-in scopes. The moment you request Gmail, Drive, or Calendar access, you're into Google's verification review. For "Sign in with Google," you don't need any of that.
  • Refresh tokens only matter if you call Google APIs. Auth.js notes Google only issues a refresh token the first time a user signs in. If all you want is a session, ignore it.
  • Add every redirect URI you'll use (localhost, your production domain, and any stable staging domain) to the OAuth client.

If you want to restrict sign-ins to one company domain, the Auth.js docs show checking profile.email_verified and the email's domain in the signIn callback.

GitHub: the default for developer tools

If your users write code, GitHub is the button they'll click. Same Auth.js setup, with GitHub from next-auth/providers/github.

Two things worth knowing:

  • GitHub OAuth apps now take up to 10 callback URLs. GitHub added this in August 2026. Before that, you basically needed a separate OAuth app for local and production. Now one app can list both. GitHub also exposes wildcard matching per callback URL, and apps that had only one callback URL have it enabled by default (that was older GitHub behavior made visible). Review it and turn it off if you don't need it.
  • Users can hide their email. The Auth.js GitHub provider asks for the read:user user:email scopes, and when the profile email is empty it fetches the user's email list and uses the primary address. Good to know when you're matching users to Stripe customers by email.

Email magic links: the fallback that catches everyone else

Magic links are the best second option, because everyone has an email address. That includes people with work Microsoft accounts and people who'd rather not connect Google to a new app.

The catches:

  • You need a database. Auth.js stores the verification token, and it says plainly that an email provider can't be enabled without a database adapter. If you're already on Prisma + Postgres for billing, it's one more table.
  • Links expire. By default, the user has 24 hours to click before they have to request a new one.
  • Use a real sending domain. With Resend, the test sender onboarding@resend.dev can only send to the email address on your Resend account. Everyone else gets a 403 until you verify your own domain (Resend recommends a subdomain like mail.yourapp.com). If magic links "work for me but not for my beta tester," this is almost always why.
import Resend from "next-auth/providers/resend"

// AUTH_RESEND_KEY is read automatically
providers: [Resend({ from: "YourApp <login@mail.yourapp.com>" })]
Enter fullscreen mode Exit fullscreen mode

The account-linking trap when you offer more than one

Here's the bug you'll meet the week you add a second provider. Someone signs up with a magic link as sam@gmail.com, then comes back and clicks "Sign in with Google" with the same address. Auth.js refuses with OAuthAccountNotLinked. That's on purpose: for security, it won't auto-link an OAuth account to an existing user who isn't signed in.

You have two options:

  1. Leave it and explain it. Show a friendly message on your sign-in error page: "You've signed in with a different method before; use that one." That's my default.
  2. Opt in to linking with allowDangerousEmailAccountLinking: true on a provider, but only when you trust that provider to have verified the email. Google gives you an email_verified flag. For GitHub, as noted above, the provider picks the primary email without checking whether it's verified, so I don't turn linking on there.

A launch checklist for sign-in

  1. AUTH_SECRET set in every environment (npx auth secret or openssl rand -base64 32).
  2. Callback URLs added for localhost and production in each provider's settings.
  3. Google OAuth app published, asking only for sign-in scopes.
  4. Resend (or another sender) using a verified domain, not the test address.
  5. A sign-in error page that explains OAuthAccountNotLinked in plain words.
  6. One real sign-in per provider on the production domain before you share the link.

Why choose ShipEmber

You can wire all of this up yourself, and the steps above are everything I'd tell a friend. I built ShipEmber because I was tired of redoing it for every project, along with the Stripe billing that comes after.

ShipEmber is a Next.js App Router starter where sign-in already works the way this post describes: Auth.js v5 with Google, GitHub, and Resend magic links, each one switched on just by adding its env vars, a Prisma adapter with database sessions, and a custom /login page. Behind it are Stripe Checkout, a customer portal route, a signature-verified webhook that keeps Free/Pro in Postgres, and a dashboard that checks the plan on the server. You still create your own OAuth apps and verify your own sending domain (no kit can do that for you), but the code is done.

Where it doesn't fit: if you need teams, organizations, SSO/SAML, or per-seat billing from day one, a bigger kit will serve you better. In my October 30 comparison, those kits were listed at $199 to $349 and up (ShipFast from $199, Makerkit Pro $349, supastarter Solo $349). ShipEmber is deliberately small: one product, a Free plan, and a Pro plan.

It's a one-time payment, $49 right now on the site (shown there as the launch price, with $79 listed as the regular price), and you can use it in unlimited personal and client projects. You get 14 days to ask for a refund if it doesn't work as described.

Prefer watching over reading? There's a short walkthrough:

Watch the ShipEmber walkthrough on YouTube

See pricing or Get ShipEmber, $49.

Related: Next.js + Stripe + Auth.js setup checklist · Prisma Schema for SaaS Billing in Next.js · Free vs Pro Feature Gating in Next.js App Router

Doc note: provider setup, callback URLs, env var names, the email-provider database requirement and 24-hour token expiry, and OAuthAccountNotLinked / allowDangerousEmailAccountLinking checked on authjs.dev; the GitHub provider email lookup checked in the next-auth source; multiple callback URLs and wildcard matching checked on docs.github.com and the GitHub changelog (Aug 14, 2026); Testing-status limits checked on developers.google.com; the resend.dev test-sender restriction and domain verification checked on resend.com/docs. All on November 19, 2026.

— Jake Mcdonald, Springfield, IL


Originally published on shipember.com.

Top comments (0)