How to redirect on same page after using google & facebook login

Redirect back to current page after sign in, sign out & sign up using google & facebook. Is it possible?

Answers

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    Yes.
  • Pls. see below my solution:

    1- top of all pages:
    if(isset($_POST['oa_action'])){
    require 'social_callback_handler_script.php';
    }

    2- the social login container


    <?php $current_uri= '//' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>



    /* Replace #your_callback_uri# with the url to your own callback script */
    var your_callback_script = <?php echo json_encode($current_uri) ;?>;

    /* Embeds the buttons into the container oa_social_login_container */
    var _oneall = _oneall || [];
    _oneall.push(['social_login', 'set_providers', ['facebook', 'google', 'twitter','windowslive']]);
    _oneall.push(['social_login', 'set_callback_uri', your_callback_script]);
    _oneall.push(['social_login', 'do_render_ui', 'oa_social_login_container']);
    _oneall.push(['social_login', 'set_popup_usage', 'autodetect']);

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.