Как настроить всех пользователей базы данных на тонкое базовое промежуточное ПО аутентификации - PullRequest
0 голосов
/ 17 октября 2018
$app->add(new Tuupola\Middleware\HttpBasicAuthentication([

    "path" => "/api",
    "realm" => "Protected",
    "users" => [
        "Username" => "kavi",
        "password" => "0000"
    ],
    "error" => function ($response, $arguments) {
      echo "false";
        $data = [];
        $data["status"] = "error";
        $data["message"] = $arguments["message"];
        // return $response->write(json_encode($data, JSON_UNESCAPED_SLASHES));
    },
    "success"=>function($response, $arguments){
        echo "true";
    }

]));
...