implement JWT tokens, regenerate docs and sqlc

This commit is contained in:
zardzul
2026-03-14 18:46:48 +01:00
parent 131aee8638
commit d5e608feeb
18 changed files with 441 additions and 82 deletions
+48
View File
@@ -26,6 +26,21 @@ definitions:
error:
type: string
type: object
handlers.LoginRequest:
properties:
password:
type: string
user_mail:
type: string
required:
- password
- user_mail
type: object
handlers.LoginResponse:
properties:
token:
type: string
type: object
handlers.UsernameResponse:
properties:
user_name:
@@ -111,4 +126,37 @@ paths:
summary: Create a user
tags:
- user
/users/login:
post:
consumes:
- application/json
parameters:
- description: Login payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/handlers.LoginRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handlers.LoginResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Log in with email and password
tags:
- user
swagger: "2.0"