Commit e498bf27 authored by Oky Rahmanto's avatar Oky Rahmanto

Merge branch 'feature/user-admin-page-rev1' into 'development'

Feature/user admin page rev1

See merge request !37
parents e362e1fa 7a36ec23
Pipeline #25551 passed with stage
in 33 seconds
......@@ -51,6 +51,7 @@ class Login extends CI_Controller {
} else {
$result = json_decode($result);
$this->session->set_userdata('nama',$result->name);
$this->session->set_userdata('token',$result->token);
if ($result->userRole->name=='Administrator') {
$this->session->set_userdata('isLogin',1);
} else
......
......@@ -229,9 +229,10 @@ class Users extends CI_Controller {
//create a new cURL resource
$ch = curl_init($this->urluser);
//penambahan bearer token
$authorization = "Authorization: Bearer ".$this->session->userdata('token');
//set the content type to application/json
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json', $authorization));
//return response instead of outputting
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
......
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