dev-resources.site
for different kinds of informations.
Authentication in NestJS with PassportJS and Prisma
Published at
9/4/2024
Categories
nestjs
javascript
passportjs
prisma
Author
Said MOUNAIM
NestJs Auth
NestJS Authentication with JWT, PassportJs, and Prisma
Getting Started
- Clone the repository:
git clone https://github.com/saidMounaim/nest-auth.git
- Install dependencies:
npm install
- Create a .env file in the root and add the following
DATABASE_URL=""
JWT_SECRET=""
- Start the development server:
npm run dev
Built With
Endpoints
Login
/auth/login
Method: POST\
Description: Authenticates a user and returns a JWT token.\
Body:
{
"email": "string",
"password": "string"
}
Register
/auth/register
Method: POST\
Description: Registers a new user and returns a user info.\
Body:
{
"name": "string",
"email": "string",
"password": "string"
}
Get currect user
/auth/profile
Method: GET\
Description: Retrieves user profile information. Requires a Bearer token for authentication.\
Body:
Authorization: Bearer <token>
Contribution
All kind of contributions are welcome, please feel free to submit pull requests.
Articles
12 articles in total
Dev Next a job platform built with Next.js, Tailwind CSS, Prisma, and NextAuth 💻
read article
Dev Next is a job platform built with Next.js, Tailwind CSS, Prisma, and NextAuth.
read article
Portfolio built with Next.js, TailwindCSS & Nodemailer
read article
AI Travel Planner app built with Next.js 15, Tailwind CSS, Prisma, Open AI, and Clerk
read article
Meetroomly app built with Next.js 15, Tailwind CSS, Prisma, and Clerk
read article
Image Reveal Animation with HTML, CSS, and GSAP
read article
Next.js 15 Form Component: A Beginner's Guide
read article
Social connect full-stack app using NestJs, Next.js, Prisma & Next-Auth
read article
Home Service Full-stack app using NestJs, Next.js, React Query TailwindCSS & Prisma
read article
Marketplace app using NestJS, Next.js 14, Tailwind CSS, Prisma, and NextAuth
read article
Nest-Connect API using NestJs, PassportJs, and Prisma
read article
Authentication in NestJS with PassportJS and Prisma
currently reading
Featured ones: