From 6262b54cce59a422a9847406eb085b9c51c9f08b Mon Sep 17 00:00:00 2001 From: creme332 <65414576+creme332@users.noreply.github.com> Date: Sat, 20 Apr 2024 10:57:45 +0400 Subject: [PATCH] replace login endpoint with session endpoint --- docs/API.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/API.md b/docs/API.md index bb9b4ba..d3a08ce 100644 --- a/docs/API.md +++ b/docs/API.md @@ -20,17 +20,16 @@ There are two types of endpoints: 1. **Public endpoints** : They return a public resource that can be accessed **without a token**. 2. **Protected endpoints** : They return a protected resource that can only be accessed **with a valid JWT token**. -### Authentication +### Session -| Endpoint | Description | Protected | -|---------------------|---------------------------------------------|-----------| -| `GET /api/v1/login` | Authenticates user and returns a JWT token. | No | +| Endpoint | Description | Protected | +|-------------------------|--------------------------------------------------|-----------| +| `POST /api/v1/sessions` | Authenticates admin and creates a session token. | No | Note: -- Only administrators can receive a JWT token. +- Only administrators can receive a session token. - Only administrators can access protected endpoints. -- The JWT token expires after 24 hours and a new one must be requested. ### User