Commit 870da95f authored by Laurent Després's avatar Laurent Després

swagger ajaxpost

parent 6e8992c2
{
"openapi": "3.0.1",
"info": {
"title": "API CoAuth",
"description": "jwt auth",
"termsOfService": "",
"contact": {
"email": "laurentd@netc.fr"
},
"version": "0.1"
},
"servers": [
{
"url": "http://192.168.0.15:2323"
}
],
"tags": [
{
"name": "chat",
"description": "module"
}
],
"paths": {
"/": {
"post": {
"summary": "",
"description": "<h1>Get Token</h1>",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"title": "params",
"properties": {
"action": {
"type": "string",
"description": "what"
},
"name": {
"type": "string",
"description": "slug"
},
"email": {
"type": "string",
"description": "email"
},
"token": {
"type": "string",
"description": "token"
}
}
}
}
}
},
"responses": {
"200": {
"description": "A token",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"components": {}
}
\ No newline at end of file
......@@ -28,6 +28,7 @@ class ApiController extends Controller
),
"person"=> array(
"get" => array("href" => "/ph/api/person/get", "public" => true),
"test" => array("href" => "/ph/api/token/index", "public" => true),
//"authenticate" => array("href" => "/ph/api/person/authenticate",'title' => "Authentication"),
//'changepassword' => array("href" => "/ph/api/person/changepassword"),
//"register" => array("href" => "/ph/api/person/register"),
......@@ -38,6 +39,9 @@ class ApiController extends Controller
"get" => array("href" => "/ph/api/activitypub/get", "public" => true),
"actor" => array("href"=> "/ph/api/abc/person/actor", "public" => true)
),
"token" => array(
"test" => array("href" => "/ph/api/token/index", "public" => true),
),
"organization"=> array(
"get" => array("href" => "/ph/api/organization/get", "public" => true),
/*"updatefield" => array("href" => "/ph/api/organization/updatefield"),
......
<?php
class TokenController extends ApiController {
protected function beforeAction($action) {
//parent::initPage();
return parent::beforeAction($action);
}
public function actions(){
return array(
'test' => $this->test(),
);
}
public function test()
{
$array = $_POST;
$token = Yii::app()->JWT->encode($array);
var_dump($array);exit;
var_dump($token);exit;
}
}
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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