From 913a8b6574c1d95d3dfde120e867d6f2457ab7ae Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 26 Feb 2025 12:26:54 +0530 Subject: [PATCH] FIX_PRE_ENROLLMENT_LOGIN_ISSUE : RV --- app/Controllers/RestAuthenticationController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index b22cbb2..235a59a 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -99,7 +99,7 @@ class RestAuthenticationController extends AdminController return $this->callThirdPartyAPI($this->request->getJSON(),'verifyEmployeeNumber'); // $result = ['user_verification' => false , 'message' => "User not found"]; - // return $this->respond(['status' => 'failed','code' => 404,'data' => $result, 'post_enrollment'=> $apiResponse],200); + // return $this->respond(['status' => 'failed','code' => 404,'data' => $result, 'post_enrollment'=> json_decode($apiResponse, true)],200); } } catch (\Throwable $th) { @@ -163,7 +163,7 @@ class RestAuthenticationController extends AdminController return $this->callThirdPartyAPI($this->request->getJSON(),'verifyEmployeeEmailId'); // $result = ['user_verification' => false , 'message' => "User not found"]; - // return $this->respond(['status' => 'failed','code' => 404,'data' => $result, 'post_enrollment'=> $apiResponse],200); + // return $this->respond(['status' => 'failed','code' => 404,'data' => $result, 'post_enrollment'=> json_decode($apiResponse, true)],200); } } catch (\Throwable $th) { @@ -217,13 +217,13 @@ class RestAuthenticationController extends AdminController // Call the third-party API function $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedUserData'); - return $this->respond(['status' => 'success','code' => 200,'data' => $result , 'post_enrollment'=> $apiResponse],200); + return $this->respond(['status' => 'success','code' => 200,'data' => $result , 'post_enrollment'=> json_decode($apiResponse, true)],200); } else { // Call the third-party API function $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedUserData'); - return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP" , 'post_enrollment'=> $apiResponse],200); + return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP" , 'post_enrollment'=> json_decode($apiResponse, true)],200); } } catch (\Exception $e) { @@ -426,11 +426,11 @@ class RestAuthenticationController extends AdminController $result = JWTToken::encode($employeeData); // Call the third-party API function $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'verifyMpin'); - return $this->respond(['status' => 'success','code' => 200,'data' => $result , 'post_enrollment'=> $apiResponse],200); + return $this->respond(['status' => 'success','code' => 200,'data' => $result , 'post_enrollment'=> json_decode($apiResponse, true)],200); } else { // Call the third-party API function $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedUserData'); - return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP", 'post_enrollment'=> $apiResponse],200); + return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP", 'post_enrollment'=> json_decode($apiResponse, true)],200); } } catch (\Exception $e) { return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);