This code only works if I do a simple post or get request.
public function authenticate(CakeRequest $request, CakeResponse $response) {
//some code - facebook
}
But in my case I have two options. Login through facebook or the normal login (form).
At the moment the problem is that when I click to submit the form the function authenticate will be also executed. So my question is: how can i detect what is the name of the Post request? something like isset($_POST['submitted_fb']
The main problem is that function is always called when I do any Post request.
Authentication only occour when you are not logged in, or, have not permission to view a page.
Do a validation like this:
and add a hidden form to your view: