Remove console.log statement in /updateCredentials endpoint

update swagger
This commit is contained in:
Thegan Govender
2024-03-09 18:35:05 +02:00
parent fbbe3670e5
commit 3579672dd7
2 changed files with 162 additions and 4 deletions

View File

@@ -152,8 +152,6 @@ router.post("/updateCredentials", async (req, res) => {
return;
}
console.log(`ENDPOINT CALLED: /updateCredentials: ` + username);
if (username !== undefined && username === "") {
result.isValid = false;
result.errorMessage = "Username cannot be empty";
@@ -173,8 +171,6 @@ router.post("/updateCredentials", async (req, res) => {
return;
}
console.log(`ENDPOINT CALLED: /updateCredentials: ` + current_password + " " + new_password);
if (config.APP_PASSWORD === current_password) {
if (config.APP_PASSWORD === new_password) {
result.isValid = false;

View File

@@ -347,6 +347,9 @@
},
"404": {
"description": "Not Found"
},
"503": {
"description": "Service Unavailable"
}
}
}
@@ -513,6 +516,69 @@
}
}
},
"/api/updateCredentials": {
"post": {
"tags": [
"API"
],
"description": "",
"parameters": [
{
"name": "authorization",
"in": "header",
"type": "string"
},
{
"name": "x-api-token",
"in": "header",
"type": "string"
},
{
"name": "req",
"in": "query",
"type": "string"
},
{
"name": "body",
"in": "body",
"schema": {
"type": "object",
"properties": {
"username": {
"example": "any"
},
"current_password": {
"example": "any"
},
"new_password": {
"example": "any"
}
}
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
},
"503": {
"description": "Service Unavailable"
}
}
}
},
"/api/updatePassword": {
"post": {
"tags": [
@@ -660,6 +726,102 @@
}
}
},
"/api/UntrackedUsers": {
"get": {
"tags": [
"API"
],
"description": "",
"parameters": [
{
"name": "authorization",
"in": "header",
"type": "string"
},
{
"name": "x-api-token",
"in": "header",
"type": "string"
},
{
"name": "req",
"in": "query",
"type": "string"
}
],
"responses": {
"200": {
"description": "OK"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
},
"503": {
"description": "Service Unavailable"
}
}
}
},
"/api/setUntrackedUsers": {
"post": {
"tags": [
"API"
],
"description": "",
"parameters": [
{
"name": "authorization",
"in": "header",
"type": "string"
},
{
"name": "x-api-token",
"in": "header",
"type": "string"
},
{
"name": "req",
"in": "query",
"type": "string"
},
{
"name": "body",
"in": "body",
"schema": {
"type": "object",
"properties": {
"userId": {
"example": "any"
}
}
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
}
}
},
"/api/keys": {
"get": {
"tags": [