Commit d0b79eec authored by nico's avatar nico Committed by okhin

Generate a token for piphone-sip api

Add a requirement on firebase/php-jwt for that purpose
parent b9ade59b
app/config.php
tests/tmp
*~
vendor
vendor/
composer.lock
tmp/
<?php
use \Firebase\JWT\JWT;
class Main extends Controller {
/*
* Home page
......@@ -30,6 +32,9 @@ class Main extends Controller {
$contact_id = $f3->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
......
......@@ -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);
......
......@@ -22,7 +22,7 @@
<div class="col-md-8">
<!-- titre -->
<div>
<h1 class="text-center" id="name">{{ @contact.first_name }} <br class="visible-xs-block">{{ @contact.last_name }}</h2>
<h1 class="text-center" id="name">{{ @contact.first_name }} <br class="visible-xs-block">{{ @contact.last_name }}</h1>
<!-- actions -->
<div class="text-center row">
<p class="lead text-center">
......
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