This topic has 9 replies, 4 voices, and was last updated 9 years by sharmstr.

  • Author
  • #57143
     clayfaith
    Participant

    Hi

    I want users to be redirected to the Activity page on login. However, the Facebook login keeps them on the same page. I have used the following in my child theme:

    COPY CODE
    function kleo_ajax_login()
    	{
    		// Check the nonce, if it fails the function will break
    		check_ajax_referer( 'kleo-ajax-login-nonce', 'security' );
    
    		// Nonce is checked, get the POST data and sign in user
    		$info = array();
    		$info['user_login'] = $_POST['log'];
    		$info['user_password'] = $_POST['pwd'];
    		$info['remember'] = (isset( $_POST['remember'] ) && $_POST['remember'] === true) ? true : false ;
    
    		$info = apply_filters('kleo_ajaxlogin_atts', $info);
    		
    		$user_signon = wp_signon( $info, false );
    		if ( is_wp_error( $user_signon ) ){
                $error_msg = $user_signon->get_error_message();
    			echo json_encode(array( 'loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i> ' . $error_msg . '</span>' ));
                //echo json_encode(array( 'loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i> ' . __( 'Wrong username or password. Please try again.', 'kleo_framework' ) . '</span>' ));
            } else {
                if ( sq_option( 'login_redirect' , 'default' ) == 'reload' ) {
                    $redirecturl = apply_filters( 'kleo_modal_login_redirect', '/activity/', '', $user_signon );
                }
                else {
                    $redirecturl = apply_filters( 'login_redirect', '', '', $user_signon );
                }
    
    			echo json_encode(array('loggedin'=>true, 'redirecturl' => $redirecturl, 'message'=> '<span class="good-response"><i class="icon icon-ok-circled"></i> ' . __( 'Login successful, redirecting...','kleo_framework' ) . '</span>' ));
    		}
    
    		die();
    	}
    

    I have also checked “reload current page” in the Misc tab under settings. I tried using the Peter’s Redirect plugin, but to no benefit.

    The weird thing is even if I login from another page, it directs me to the Home page instead of the Activity page.

    I have done everything in my knowledge to fix this. Now it’s your turn.

    Thanks!

    #57144
     clayfaith
    Participant
    This reply has been set as private.
    #57178
     clayfaith
    Participant

    Hello Seventhqueen

    Please reply to the above query.

    Thanks

    #57256
     clayfaith
    Participant

    Hi

    Why am I not getting any reply for this question? Is this some kind of permanent bug with the theme?

    Please reply.

    #57260
     sharmstr
    Moderator

    Read the bottom of this: http://sharmstr.com/login-redirect/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #57264
     Abe
    Keymaster

    Hi, the facebook redirect now just refreshes the page but we will be releasing an update around 15th this month to include the redirect logic to Facebook too

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #57784
     clayfaith
    Participant

    @sharmstr, your solution worked for me! Thanks! Please add this in the theme. Thanks @Abe.

    #57786
     sharmstr
    Moderator

    Its already been added. Make sure you to delete the custom code after the update.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #60115
     btrites
    Participant

    Hi.. I am just checking in on the status of this update. Do you know when the re-direct will be available?
    Thanks!

    #60119
     sharmstr
    Moderator

    Any day now.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 10 posts - 1 through 10 (of 10 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?