Explorar el Código

add auth to all route methods

CauseFX hace 5 años
padre
commit
97c274b8ba
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      api/v2/routes/root.php

+ 2 - 2
api/v2/routes/root.php

@@ -36,7 +36,7 @@ $app->get('/status', function ($request, $response, $args) {
 		->withHeader('Content-Type', 'application/json;charset=UTF-8')
 		->withHeader('Content-Type', 'application/json;charset=UTF-8')
 		->withStatus($GLOBALS['responseCode']);
 		->withStatus($GLOBALS['responseCode']);
 });
 });
-$app->get('/auth', function ($request, $response, $args) {
+$app->any('/auth', function ($request, $response, $args) {
 	/**
 	/**
 	 * @OA\Get(
 	 * @OA\Get(
 	 *     path="/api/v2/auth",
 	 *     path="/api/v2/auth",
@@ -91,7 +91,7 @@ $app->get('/auth', function ($request, $response, $args) {
 		->withHeader('Content-Type', 'application/json;charset=UTF-8')
 		->withHeader('Content-Type', 'application/json;charset=UTF-8')
 		->withStatus($GLOBALS['responseCode']);
 		->withStatus($GLOBALS['responseCode']);
 });
 });
-$app->get('/auth-{group}', function ($request, $response, $args) {
+$app->any('/auth-{group}', function ($request, $response, $args) {
 	$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
 	$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
 	$_GET['group'] = $args['group'];
 	$_GET['group'] = $args['group'];
 	$Organizr->auth();
 	$Organizr->auth();