mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-11 03:41:42 +00:00
First draft for user / login and logout
This commit is contained in:
parent
ee53086444
commit
15136e2562
5 changed files with 274 additions and 0 deletions
73
docs/controllers/AuthController.yaml
Normal file
73
docs/controllers/AuthController.yaml
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
paths:
|
||||
/login:
|
||||
post:
|
||||
summary: Login to the server
|
||||
description: Logs in a client to the server, returning information about the user and server.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
username:
|
||||
$ref: '../objects/entities/User.yaml#/components/schemas/username'
|
||||
password:
|
||||
$ref: '../objects/entities/User.yaml#/components/schemas/password'
|
||||
required:
|
||||
- username
|
||||
- password
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
user:
|
||||
type: object
|
||||
properties:
|
||||
$ref: '../objects/entities/User.yaml#/components/schemas/user'
|
||||
'401':
|
||||
description: Unauthorized - Invalid username or password.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
/logout:
|
||||
post:
|
||||
summary: Logout from the server
|
||||
description: Logs out a client from the server. If the socketId parameter is provided, the server removes the socket from the client list.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
socketId:
|
||||
$ref: '../objects/entities/User.yaml#/components/schemas/socketId'
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
example: Successfully logged out.
|
||||
'401':
|
||||
description: Unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
Loading…
Add table
Add a link
Reference in a new issue