nextjs-jwt-example
next.js authorization example including private route protection. WARNING - This is probably not a great reference in 2023 and beyond, consider using next-auth.
File Explorer
Download Latest Version (.zip)- codeStyleConfig.xml
- .gitignore
- misc.xml
- modules.xml
- nextjs-jwt-example.iml
- vcs.xml
- go.mod
- go.sum
- main.go
- links.tsx
- private_route.tsx
- dashboard.tsx
- index.tsx
- login.tsx
- auth_token.ts
- error.ts
- login_service.ts
- rest_service.ts
- .gitignore
- package-lock.json
- package.json
- README.md
- tsconfig.json
- .gitignore
- go.mod
- go.sum
- LICENSE
- README.md
# Installation Guide
1. Get the code
git clone https://github.com/jasonraimondi/nextjs-jwt-example
Downloads the entire project code from GitHub to your computer.
cd nextjs-jwt-example
Moves into the project folder you just downloaded.
2. Node.js
Easy RecommendedPrerequisites
npm run dev
Starts the development/run server.
After running the command, open the address shown in the terminal (usually something like http://localhost:3000) in your browser.
Pulled directly from this repo's README.
3. Go
MediumPrerequisites
go run ./api/main.go
Runs the Go program directly without a separate build step.
If the build finishes without errors, it worked. If you used go run ., check the terminal output.
Pulled directly from this repo's README.
// repository documentation
Was this content helpful?
(0 ratings)
