Skip to content

thakkarchintan411/auth-nextjs-demo

Repository files navigation

Auth Next.js Demo

Installation

To install the project dependencies, run the following command:

npm install

Set up DB URL and SECRET KEY

.env.local.example file is provided so create new .env.local file and set env there.

Running the Project

To start the development server, use:

npm run dev

API Documentation

Authentication Endpoints

Register

  • URL: /api/auth/register
  • Method: POST
  • Description: Registers a new user.
  • Request Body:
    {
      "fullName": "string",
      "email": "string",
      "password": "string"
    }
  • Response:
    {
      "status": 200,
      "message": "User registered successfully"
    }

Login

  • URL: /api/auth/login

  • Method: POST

  • Description: Authenticates a user and returns a token.

  • Request Body:

    {
      "email": "string",
      "password": "string"
    }
  • Response:

    {
      "token": "string"
    }

    Documentation

    You can find postman collection file so import to get test apis in postman.

About

nextjs-authentication-apis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published