Add /token endpoint

This commit is contained in:
2025-01-30 17:42:36 +01:00
parent 2176e5eece
commit 540aa91830

View File

@ -33,6 +33,24 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/HelloResponse"
/token:
post:
tags:
- session
summary: Create a bearer token
operationId: createToken
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateSessionRequest"
responses:
200:
description: "New token was generated"
content:
application/json:
schema:
$ref: "#/components/schemas/CreateSessionResponse"
components:
schemas:
@ -42,6 +60,25 @@ components:
value:
type: string
CreateSessionRequest:
type: object
required:
- username
- password
properties:
username:
type: string
password:
type: string
CreateSessionResponse:
type: object
required:
- token
properties:
token:
type: string
ErrorResponse:
type: object
required: