Repository navigation
Replies: 1 comment
|
@tianhuil Using a mock GitHub provider for development and local Playwright tests in As long as production builds seamlessly fall back to the real GitHub provider using standard env vars, this approach significantly lowers the barrier to entry for trying out the example and ensures reliable CI sign-in coverage without breaking production expectations. Great initiative! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
examples/authneeds a GitHub OAuth app beforenpm run devcan sign in, and it has no tests. I'd like to propose using a mock of GitHub in development and tests, keeping real GitHub in production, and adding a Playwright sign-in test.Proposal
auth.tsusesMockGitHub()from@mockatoo/connect-authjs(MIT). That is Auth.js's own GitHub provider pointed at a hosted mock of GitHub, Mockatoo. Production builds keepGitHuband the existing env vars, and the Deploy button doesn't change.e2e/sign-in.spec.ts, laid out likeexamples/with-playwright, that signs in and out. Real GitHub can't be used for this because of bot checks, 2FA and rate limits.Draft PR: #101775. It also adds a workflow that typechecks, builds and runs the sign-in test whenever
examples/authchanges, and skips the test when no Mockatoo credentials are set. It is stacked on #101774, which separately fixes the example's build:typescript: latestis now TypeScript 7, which rejectstarget: "es5".Disclosure: I build Mockatoo. It's free, the connectors are open source at mockatoo/connectors, and test credentials need an account made with an email address.
Question
Is this a change you'd accept in
examples/auth? Or would you prefer it as a separate example, or not at all? @icyJoseph, since you've been reviewing example PRs.All reactions