”checkToken()” which used Load Balancer in AWS didn't function. By what kind of idea is security check being performed?
$.ajax({
url: '/api/checkToken'
type: 'POST',
dataType: 'json',
data: {
'token_key':'{{security.getTokenKey()}}',
'token':'{{security.getToken()}}'
},
success: function(json){
switch(json.status){
case "ok":
// processing...
break;
case "ng":
// processing...
break;
}
}
});
public function checkTokenAction()
{
$tokenKey = $this->request->getPost("token_key");
$token = $this->request->getPost("token");
header("Content-Type: application/json");
if( $this->security->checkToken($tokenKey, $token) ){
echo '{"status":"ok"}';
}else{
echo '{"status":"error"}';
}
return;
}