Added auxstart API call

This commit is contained in:
tokslaw7
2023-07-09 00:56:15 +00:00
parent 1048638557
commit 3739ddcaee
2 changed files with 18 additions and 20 deletions
-12
View File
@@ -301,18 +301,6 @@ class WrenchApi extends BaseController
$in["login_mode"] = MOBILE_LOGIN;
}
break;
case 'authstart':
$in["action"] = WRENCHBOARD_ACCOUNT_AUXSTART;
if (!isset($in["login_mode"])){
$in["login_mode"] = MOBILE_LOGIN;
}
break;
case 'authlogin':
$in["action"] = WRENCHBOARD_ACCOUNT_AUXLOGIN;
if (!isset($in["login_mode"])){
$in["login_mode"] = MOBILE_LOGIN;
}
break;
case 'dashdata': $in["action"] = WRENCHBOARD_ACCOUNT_DASHDATA;
break;
case 'offerslist': $in["action"] = WRENCHBOARD_MOBILE_OFFERSLIST;
+18 -8
View File
@@ -19,6 +19,15 @@ class WrenchOauth extends BaseController
$envID = getenv('ENV_ID');
}
public function endPointList(){
$endpoints = [
'authstart' => ['POST'],
'authlogin' => ['POST'],
];
return $endpoints;
}
public function apigate(){
log_message('critical', "Oauth-Gate");
@@ -62,7 +71,7 @@ class WrenchOauth extends BaseController
http_response_code(404);
// tell the user product does not exist
echo json_encode([
'message' => 'Endpoint not found.',
'message' => 'HEREEndpoint not found.',
'URI' => $uri,
]);
}
@@ -108,20 +117,21 @@ class WrenchOauth extends BaseController
}
private function prepareOauthEndPointData($endpoint, $in, &$call_backend=true,&$local_out=[]){
private function prepareOauthEndPointData($endpoint, &$in, &$call_backend=true,&$local_out=[]){
log_message('critical', "Started prepareOauthEndPointData -> ".$endpoint );
switch ($endpoint) {
case 'authstart':
// may not need to call back end , juet get the configurations
switch($in["auth_type"]){
case 'GOOGLE':
log_message('critical', "Reading prepareOauthEndPointData -> ".$endpoint );
$local_out["GOOGLE_CLIENT_ID"] = $this->getSiteConfigurations("google.google_client_id");
$local_out["GOOGLE_CLIENT_SECRET"] = $this->getSiteConfigurations("google.google_client_secret");
break;
log_message('critical', "Reading prepareOauthEndPointData -> ".$endpoint );
$in["login_channel"] = "990010"; /* LOGIN_GOOGLE */
$in["GOOGLE_CLIENT_ID"] = $this->getSiteConfigurations("google.google_client_id");
$in["GOOGLE_CLIENT_SECRET"] = $this->getSiteConfigurations("google.google_client_secret");
break;
}
log_message('critical', "prepareOauthEndPointDataL FINAL DATA".serialize($local_out) );
$call_backend=false;
$call_backend=true;
break;
case 'authlogin':
// not really implemented
@@ -135,4 +145,4 @@ class WrenchOauth extends BaseController
return $in;
}
}
}