Facebook logout button and redirect after logout

后端 未结 3 852
生来不讨喜
生来不讨喜 2021-02-08 15:43

I use this code

         


        
3条回答
  •  日久生厌
    2021-02-08 16:06

    Above answer by Piskvor did it for me. Its crazy how many hours I've spend trying to figure this out.

    Main problem with plugins such as this Facebook for CakePHP is that they don't come with updates. APIs, especially popular ones like Facebook, change all the time because they are being imporved. If the guy who wrote it initially as a hobby moves on with his life and stops updating the SDK people who are less knowladgable on how to alter these things become stuck.

    WORKING CODE:

    Nevertheless, thanks for a great solution Piskvor, here is my piece of code for

    apps/plugins/facebook/views/helpers/facebook.php
    
                $init .= $this->Html->scriptBlock(
    <<

    The key piece of code here is:

         FB.Event.subscribe("auth.logout", function() {
             window.location = '/users/logout'
         });
        {$callback}
    

提交回复
热议问题