Verified Commit 82346744 authored by Damien's avatar Damien

FEAT #10837 TIME 0:15 getConnection

parent 00c57845
......@@ -26,7 +26,7 @@ $app->add(function (\Slim\Http\Request $request, \Slim\Http\Response $response,
if (!is_file($configPath . '/config.xml')) {
return $response->withStatus(400)->withJson(['errors' => 'Configuration file is missing']);
}
$routesWithoutAuthentication = ['POST/log', 'POST/password', 'PUT/password', 'GET/passwordRules', 'GET/languages/{lang}'];
$routesWithoutAuthentication = ['GET/connection', 'POST/log', 'POST/password', 'PUT/password', 'GET/passwordRules', 'GET/languages/{lang}'];
$route = $request->getAttribute('route');
$currentMethod = empty($route) ? '' : $route->getMethods()[0];
$currentRoute = empty($route) ? '' : $route->getPattern();
......@@ -48,6 +48,7 @@ $app->add(function (\Slim\Http\Request $request, \Slim\Http\Response $response,
});
//Authentication
$app->get('/connection', \SrcCore\controllers\AuthenticationController::class . ':getConnection');
$app->post('/log', \SrcCore\controllers\AuthenticationController::class . ':log');
$app->get('/logout', \SrcCore\controllers\AuthenticationController::class . ':logout');
......
......@@ -123,4 +123,11 @@ class AuthenticationController
return $response->withJson(['success' => 'success']);
}
public static function getConnection(Request $request, Response $response)
{
$connection = ConfigurationModel::getConnection();
return $response->withJson(['connection' => $connection]);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment