mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-16 03:10:31 +01:00
34 lines
848 B
JavaScript
34 lines
848 B
JavaScript
|
const { validApiKey } = require("../../../utils/middleware/validApiKey");
|
||
|
|
||
|
function apiAuthEndpoints(app) {
|
||
|
if (!app) return;
|
||
|
|
||
|
app.get("/v1/auth", [validApiKey], (_, response) => {
|
||
|
/*
|
||
|
#swagger.tags = ['Authentication']
|
||
|
#swagger.description = 'Verify the attached Authentication header contains a valid API token.'
|
||
|
#swagger.responses[200] = {
|
||
|
description: 'Valid auth token was found.',
|
||
|
content: {
|
||
|
"application/json": {
|
||
|
schema: {
|
||
|
type: 'object',
|
||
|
example: {
|
||
|
authenticated: true,
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
#swagger.responses[403] = {
|
||
|
schema: {
|
||
|
"$ref": "#/definitions/InvalidAPIKey"
|
||
|
}
|
||
|
}
|
||
|
*/
|
||
|
response.status(200).json({ authenticated: true });
|
||
|
});
|
||
|
}
|
||
|
|
||
|
module.exports = { apiAuthEndpoints };
|