new Login Api 2 : ps
This commit is contained in:
parent
73cca0bd46
commit
12ccaa6efd
@ -1501,6 +1501,10 @@ class Common_Masters_Controller extends REST_Controller {
|
|||||||
public function login_post() {
|
public function login_post() {
|
||||||
// $username= "mwisesales1@sine.com";
|
// $username= "mwisesales1@sine.com";
|
||||||
// $password ="test1234";
|
// $password ="test1234";
|
||||||
|
$username= $this->post('un');
|
||||||
|
$password = $this->post('pwd');
|
||||||
|
// echo $username;
|
||||||
|
// echo $password;die;
|
||||||
$result = $this->aws_cognito->login($username, $password);
|
$result = $this->aws_cognito->login($username, $password);
|
||||||
// $this->response($result,REST_Controller::HTTP_OK);
|
// $this->response($result,REST_Controller::HTTP_OK);
|
||||||
if($result[0]){
|
if($result[0]){
|
||||||
@ -1508,24 +1512,14 @@ class Common_Masters_Controller extends REST_Controller {
|
|||||||
$data['status'] = REST_Controller::HTTP_OK;
|
$data['status'] = REST_Controller::HTTP_OK;
|
||||||
$data['token'] = $result[1];
|
$data['token'] = $result[1];
|
||||||
}else{
|
}else{
|
||||||
|
$data['dataStatus'] = false;
|
||||||
|
$data['status'] = REST_Controller::HTTP_NOT_FOUND;
|
||||||
if (str_contains($result[1], 'Incorrect username or password.')) {
|
if (str_contains($result[1], 'Incorrect username or password.')) {
|
||||||
$data['msg'] = 'Incorrect username or password.';
|
$data['msg'] = 'Incorrect username or password.';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$data['msg'] = 'Something Went Wrong, Try Again';
|
$data['msg'] = 'Something Went Wrong, Try Again';
|
||||||
}
|
}
|
||||||
$data['dataStatus'] = false;
|
|
||||||
$data['status'] = REST_Controller::HTTP_NOT_FOUND;
|
|
||||||
// $data['msg'] = $result[1];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// print_r(json_encode($result[1]));
|
|
||||||
// print_r(json_decode($result[1]));
|
|
||||||
// echo $result[1]['response'];
|
|
||||||
// print_r($result[1]);
|
|
||||||
// echo gettype($result[1]);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
$this->response($data,REST_Controller::HTTP_OK);
|
$this->response($data,REST_Controller::HTTP_OK);
|
||||||
// return $result;
|
// return $result;
|
||||||
|
|||||||
@ -72,7 +72,7 @@ class AUTHORIZATION
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( $routingName == ROUTE_LOGIN_X || $routingName == ROUTE_LOGIN_Y || $routingName == ROUTE_LOGIN_Z || $routingName == ROUTE_LOGIN_W || $routingName == ROUTE_LOGIN_V || $routingName == ROUTE_LOGIN_A || $routingName == TURN_SERVER_API || $routingName == VIDEO_CHAT_ACCESS_KEY_API || $routingName ==SAVEROOMINFO_API || $routingName ==SAVESMCCREDITPDIMAGE_API || $routingName ==GETSMCPDIMGSECTIONDATA_API || $routingName == ROUTE_LOGIN_T || $routingName == ROUTE_LOGIN_U || $routingName == ROUTE_LOGIN_B || $routingName == ROUTE_LOGIN_C || $routingName == ROUTE_LOGIN_D || $routingName == ROUTE_LOGIN_E || $routingName == ROUTE_LOGIN_F || $routingName == ROUTE_LOGIN_S || $routingName == ROUTE_LOGIN_G || $routingName == ROUTE_LOGIN_H || $routingName == ROUTE_LOGIN_I || $routingName == ROUTE_LOGIN_J)
|
if( $routingName == ROUTE_LOGIN_X || $routingName == ROUTE_LOGIN_Y || $routingName == ROUTE_LOGIN_Z || $routingName == ROUTE_LOGIN_W || $routingName == ROUTE_LOGIN_V || $routingName == ROUTE_LOGIN_A || $routingName == TURN_SERVER_API || $routingName == VIDEO_CHAT_ACCESS_KEY_API || $routingName ==SAVEROOMINFO_API || $routingName ==SAVESMCCREDITPDIMAGE_API || $routingName ==GETSMCPDIMGSECTIONDATA_API || $routingName == ROUTE_LOGIN_T || $routingName == ROUTE_LOGIN_U || $routingName == ROUTE_LOGIN_B || $routingName == ROUTE_LOGIN_C || $routingName == ROUTE_LOGIN_D || $routingName == ROUTE_LOGIN_E || $routingName == ROUTE_LOGIN_F || $routingName == ROUTE_LOGIN_S || $routingName == ROUTE_LOGIN_G || $routingName == ROUTE_LOGIN_H || $routingName == ROUTE_LOGIN_I)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user