> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fairfood.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Login Endpoint

> The JWT Authentication endpoint enables users to obtain JSON Web Tokens (JWT) for secure authentication. Upon successful login, the API provides both an access token and a refresh token encoded as JWTs, allowing authenticated access to protected resources and token renewal for prolonged usage.



## OpenAPI

````yaml post /auth/login/
openapi: 3.0.1
info:
  title: Trace Connect API
  version: v1
servers:
  - url: http://localhost:3000/connect/v1
security:
  - Bearer: []
paths:
  /auth/login/:
    post:
      tags:
        - auth
      summary: API to login User.
      description: Takes in Email and password to login user with a session.
      operationId: auth_login_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APILogin'
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APILogin'
components:
  schemas:
    APILogin:
      required:
        - device_id
        - password
        - username
      type: object
      properties:
        username:
          title: Username
          minLength: 1
          type: string
        password:
          title: Password
          minLength: 1
          type: string
        device_id:
          title: Device id
          minLength: 1
          type: string
        device_name:
          title: Device name
          minLength: 1
          type: string
        device_loc:
          title: Device loc
          minLength: 1
          type: string
        force_logout:
          title: Force logout
          type: boolean
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````