ITLD
LoginGet Started
Beginner

iPad Air M4 11-inch (2026)

AUTH APIs (NextAuth Based)

aiwebdevelopment
iPad Air M4 11-inch (2026)

LKR 4,000.00

Enroll Now

AUTH APIs (NextAuth Based)

1. Login (Credentials)

Title: Login User

API Url
POST /api/auth/callback/credentials

REQUEST BODY

{
  "email": "john@email.com",
  "password": "12345678"
}


Note:

  • Handled by NextAuth CredentialsProvider

  • You validate user from DB inside authorize()

SUCCESS RESPONSE

{
  "user": {
    "id": "user_001",
    "email": "john@email.com",
    "role": "student"
  },
  "accessToken": "jwt_token"
}


ERROR RESPONSE

{
  "error": "Invalid credentials"
}

Lessons

Lessons will be published soon.