https://github.com/yowainwright/next-auth-learning
This a basic Github org auth demo using nextjs, next-auth, and octokit
https://github.com/yowainwright/next-auth-learning
next-auth nextjs octokit
Last synced: 11 months ago
JSON representation
This a basic Github org auth demo using nextjs, next-auth, and octokit
- Host: GitHub
- URL: https://github.com/yowainwright/next-auth-learning
- Owner: yowainwright
- Created: 2024-06-28T06:39:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-10T20:55:49.000Z (over 1 year ago)
- Last Synced: 2025-01-01T20:09:30.921Z (about 1 year ago)
- Topics: next-auth, nextjs, octokit
- Language: TypeScript
- Homepage:
- Size: 203 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next Auth Learning Using the Github Provider
This is a Next Auth Learning Project.
---
## Try it out
- Copy `.env.example` as `.env.local` and follow the text instructions.
- Then, run \*`n i auto` and `pnpm i && pnpm dev`. Open [http://localhost:3000](http://localhost:3000) to see the result.
> [!NOTE]
> *These commands assume you have `n` (or `nvm`) for node and `pnpm` for package management installed.
> _Run `brew install n` and `npm install pnpm -g` if not._
---
## What will I see after setup?
You will see a basic screen with a login button in your browser. By clicking on the login button, you will be taken to a Github auth page. Once you authenticate with Github, if you're a member of the Github org you specified in your `.env.local` `NEXT_PUBLIC_ORG` value, you will be redirected back to the app home page with your Github username displayed. If you're not a member of the org you specified, you'll be directed to an unauthorized page with the option to sign in appropriately.
- You can test failures, etc by changing the org in `src/app/utils/checkMembership.ts`, or signing in with a non-member account.
- You can sign out by clicking the "Sign out" button and "Sign in" again.