Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logout from app only not from facebook #131

Open
andreirebe opened this issue Apr 11, 2013 · 13 comments
Open

Logout from app only not from facebook #131

andreirebe opened this issue Apr 11, 2013 · 13 comments

Comments

@andreirebe
Copy link
Contributor

I would really like some solution to this problem. I tried every possible way to logout only from my app and not from facebook and I did not found a solution. Someone said that noAuth should be set to true, but if I set noAuth to true then I cannot login anymore (it just refreshes the page with no login no nothing it's just like the button has not been clicked)

A very big thank you in advance to anyone who can share the answer to this question.

@oidacra
Copy link

oidacra commented Apr 11, 2013

I have the same problem.

@mlumbroso
Copy link

Me too

@DColl
Copy link

DColl commented May 4, 2013

I believe it would be easier if you described in a concrete way "why" (what's the logic behind this behavior) you want to be logged out of your app and not from facebook.

Until then, have you tried putting a link /users/logout which would be something like

    public function logout() {
        $this->Auth->logout();
        $this->Session->destroy();
        $this->redirect('/');
    }

Problem is that Connect component will probably relog your user automagically when he comes back to your app. Sooo.. you can be logged out of your app as long as you don't return to it after the call to /user/logout.

@andreirebe
Copy link
Contributor Author

It does not work. And I have never seen a site that does not offer logout from the app only.

@andreirebe andreirebe reopened this May 4, 2013
@DColl
Copy link

DColl commented May 4, 2013

Ok, so you're speaking of a site, not an inside-facebook app right ?

@andreirebe
Copy link
Contributor Author

yes

@DColl
Copy link

DColl commented May 4, 2013

Have you tried using the connect component only from the UserController ? Even directly from the login action

public function login(){
    $this->set('facebookUser', $this->Connect->user()); //or whatever the use you make
}

I may have spelled the call to the component wrong..

@andreirebe
Copy link
Contributor Author

It tells me ConnectComponent does not exist ...

@andreirebe
Copy link
Contributor Author

I even tried it to put it in $components under users controller

@DColl
Copy link

DColl commented May 4, 2013

On the fly would be done like this :

$this->Connect = $this->Components->load('Facebook.Connect', array('model' => 'User'));
$this->Connect->initialize($this);
    $this->set('facebookUser', $this->Connect->user());

But loading it in the $components array is still much simpler. Don't forget to add the other components you normally need !

@andreirebe
Copy link
Contributor Author

Yes, no more error but now I cannot login anymore. I can login only with my site username/password. If I try with facebook I only get an page refresh

@DColl
Copy link

DColl commented May 4, 2013

the login dialog must redirect to the controller/action where ConnectComponent is activated. Not sure how to do this, but check the possible settings in the facebookhelper->login()

Keep us posted on your advancement ;)

@andreirebe
Copy link
Contributor Author

The actual redirect is not the problem. I can make it redirect wherever I want. But it does not log me in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants