diff --git a/.gitignore b/.gitignore index eb2a1c189d7b9f6268d92a6624c4fbaead330f25..cd2789c210cdfc9ed8529f6bdfa0998a862b4852 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ app/config.php tests/tmp *~ -vendor +vendor/ composer.lock +tmp/ diff --git a/app/Main.php b/app/Main.php index 896fb0c1ecaf2c1b67e34678b43137ad4fd4a3c9..dd75524c0855635fa56d515002644d5e57191d62 100644 --- a/app/Main.php +++ b/app/Main.php @@ -1,5 +1,7 @@ get('POST.contact_id'); $f3->set("contact_id", $contact_id); + // Generate a jwt token + $token = JWT::encode(array('api' => JWT_TOKEN), JWT_KEY); + //TODO: create call //TODO: start call diff --git a/app/config.php.sample b/app/config.php.sample index 1dd104a6b53ff75815d8d50ecc24e8494711f237..1ecbdcb95928577adbd14f99ec17305f90999643 100644 --- a/app/config.php.sample +++ b/app/config.php.sample @@ -3,6 +3,8 @@ define("CAMPAIGN_ID","1"); define("API_BASE","http://localhost/restapi/"); define("API_TIMEOUT","1"); +define("JWT_KEY", "YOUR_KEY"); +define("JWT_TOKEN", "YOUR_TOKEN"); /* TODO : remove this in production ;) */ error_reporting(E_ALL|E_WARNING); diff --git a/composer.json b/composer.json index a21db9d88d965ffe2eb4c7b513dcbc8a587c55b8..99cbe060106b48c4969ddf942fa7089c5667c4ab 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "require": { - "bcosca/fatfree": "^3.5" + "bcosca/fatfree": "^3.5", + "firebase/php-jwt": "^4.0" } } diff --git a/templates/contact.html b/templates/contact.html index 5f803ccf875525ca1d11d36c4869294d0565c98e..b757c8a7d139c50b3f21c4bc274c720ab787027b 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -22,7 +22,7 @@
-

{{ @contact.first_name }}
{{ @contact.last_name }}

+

{{ @contact.first_name }}
{{ @contact.last_name }}