Misc docs

This commit is contained in:
Arne Keller
2025-05-03 08:47:43 +02:00
committed by FliegendeWurst
parent 9b188503db
commit 6467265cfd
3 changed files with 35 additions and 2 deletions

View File

@@ -62,6 +62,36 @@ function setPassword(req: Request, res: Response) {
res.redirect("login");
}
/**
* @swagger
* /login:
* post:
* tags:
* - auth
* summary: Log in using password
* description: This will give you a Trilium session, which is required for some other API endpoints. `totpToken` is only required if the user configured TOTP authentication.
* operationId: login-normal
* externalDocs:
* description: HMAC calculation
* url: https://github.com/TriliumNext/Notes/blob/v0.91.6/src/services/utils.ts#L62-L66
* requestBody:
* content:
* application/x-www-form-urlencoded:
* schema:
* type: object
* required:
* - password
* properties:
* password:
* type: string
* totpToken:
* type: string
* responses:
* '200':
* description: Successful operation
* '401':
* description: Password / TOTP mismatch
*/
function login(req: Request, res: Response) {
if (openID.isOpenIDEnabled()) {
res.oidc.login({