Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
5c4916e515
@ -69,6 +69,8 @@ use Kreait\Firebase\Messaging\CloudMessage;
|
|||||||
use Kreait\Firebase\Messaging\Notification;
|
use Kreait\Firebase\Messaging\Notification;
|
||||||
use Kreait\Firebase\Exception\MessagingException;
|
use Kreait\Firebase\Exception\MessagingException;
|
||||||
|
|
||||||
|
use Firebase\JWT\JWT;
|
||||||
|
|
||||||
|
|
||||||
class EmployeeRestController extends AdminController
|
class EmployeeRestController extends AdminController
|
||||||
{
|
{
|
||||||
@ -5441,7 +5443,7 @@ class EmployeeRestController extends AdminController
|
|||||||
// $dashboard_id = $this->request->getGet('dashboard_id') ?? null;
|
// $dashboard_id = $this->request->getGet('dashboard_id') ?? null;
|
||||||
$client_id = $this->request->getPost('client_id') ?? null;
|
$client_id = $this->request->getPost('client_id') ?? null;
|
||||||
$client_policy_id = $this->request->getPost('client_policy_id') ?? null;
|
$client_policy_id = $this->request->getPost('client_policy_id') ?? null;
|
||||||
|
$received_data = $this->request->getJSON(true) ?? null;
|
||||||
// 🔐 Move this to .env in real projects
|
// 🔐 Move this to .env in real projects
|
||||||
$METABASE_SECRET_KEY = '6a9ec3d833576923ea04078188fe26cad17b5de351ab3ce349dd2c2d07b5d0cd';
|
$METABASE_SECRET_KEY = '6a9ec3d833576923ea04078188fe26cad17b5de351ab3ce349dd2c2d07b5d0cd';
|
||||||
|
|
||||||
@ -5450,7 +5452,7 @@ class EmployeeRestController extends AdminController
|
|||||||
// 'dashboard' => 1
|
// 'dashboard' => 1
|
||||||
'dashboard' => 2
|
'dashboard' => 2
|
||||||
],
|
],
|
||||||
'params' => (object)['client_policy_id' => $client_policy_id], // MUST be object for Metabase
|
'params' => (object)['client_policy_id' => $received_data['client_policy_id']], // MUST be object for Metabase
|
||||||
'exp' => time() + (10 * 60) // 10 minutes
|
'exp' => time() + (10 * 60) // 10 minutes
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -5461,8 +5463,8 @@ class EmployeeRestController extends AdminController
|
|||||||
// 'token' => $token,
|
// 'token' => $token,
|
||||||
// 'iframe_url' => "https://your-metabase-domain/embed/dashboard/{$token}#bordered=true&titled=true"
|
// 'iframe_url' => "https://your-metabase-domain/embed/dashboard/{$token}#bordered=true&titled=true"
|
||||||
// ]);
|
// ]);
|
||||||
if($this->request->getGet('api') == 1)
|
// if($this->request->getGet('api') == 1)
|
||||||
{
|
// {
|
||||||
return $this->respond([
|
return $this->respond([
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'message' => 'Form data received successfully!',
|
'message' => 'Form data received successfully!',
|
||||||
@ -5470,7 +5472,7 @@ class EmployeeRestController extends AdminController
|
|||||||
'metabaseToken' => $token,
|
'metabaseToken' => $token,
|
||||||
'metabaseUrl' => 'https://nsights.nhanceindia.in']
|
'metabaseUrl' => 'https://nsights.nhanceindia.in']
|
||||||
]);
|
]);
|
||||||
}
|
// }
|
||||||
|
|
||||||
return view('meta_dashboard_demo_one', [
|
return view('meta_dashboard_demo_one', [
|
||||||
'metabaseToken' => $token,
|
'metabaseToken' => $token,
|
||||||
|
|||||||
@ -996,10 +996,10 @@ class TestingController extends BaseController
|
|||||||
// 'dashboard' => 1
|
// 'dashboard' => 1
|
||||||
'dashboard' => 2
|
'dashboard' => 2
|
||||||
],
|
],
|
||||||
'params' => (object)['client' => 3776], // MUST be object for Metabase
|
'params' => (object)['client_policy' => 108], // MUST be object for Metabase
|
||||||
'exp' => time() + (10 * 60) // 10 minutes
|
'exp' => time() + (10 * 60) // 10 minutes
|
||||||
];
|
];
|
||||||
|
// dd($payload);
|
||||||
$token = JWT::encode($payload, $METABASE_SECRET_KEY, 'HS256');
|
$token = JWT::encode($payload, $METABASE_SECRET_KEY, 'HS256');
|
||||||
|
|
||||||
// // You can either return token only
|
// // You can either return token only
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user