• Resolved jbarrowcliffe

    (@jbarrowcliffe)


    The library-viewer plugin looks and works great for the simple list I need to display however, after installing and activating free library-viewer the login/out widget no longer logs out users if a redirect is used.
    The widget triggers a URL like the following for a logged in user but just returns to the home page without logging out the user. This can also just be placed in a custom link and still fail the same.
    https://mysite.com/wp-login.php?action=logout&redirect_to=https%3A%2F%2Fmysite.com%2F&_wpnonce=5d154c7c4b

    If I create a custom link with a logout but no redirect then it works fine:
    https://mysite.com/wp-login.php?action=logout
    This takes me to a “are you sure you want to logout page”
    I do not have any other plugins active and I haven’t even configured the library viewer to be used in any pages. I am currently using the Pen theme but the problem is shown with other themes too.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Pexle Chris

    (@pexlechris)

    Hi.

    In my installation works fine.

    There is an action in my plugin that does the redirect.

    It is the “custom_login_redirect_action” public method.

    That is defined in line 190 in file wp-content/plugins/library-viewer/library-viewer.php

    Do you want to try to change method with following method

    	public function custom_login_redirect_action() {
    		if( isset($_GET['action']) ) return;
    		if( is_user_logged_in() && isset($_GET['redirect_to']) && !empty($_GET['redirect_to']) ){
    			$redirect_url = $_GET['redirect_to'];
    			if ( wp_redirect( $redirect_url ) ) {
    				exit;
    			}
    		}
    	}

    I have added only the first line.

    Is it ok now?

    Plugin Author Pexle Chris

    (@pexlechris)

    Did it work?

    Thread Starter jbarrowcliffe

    (@jbarrowcliffe)

    Hi Pexle,
    I didn’t get a chance to try it until today.
    Looks like that has fixed the issue.
    Thanks very much for the quick response!

    Thread Starter jbarrowcliffe

    (@jbarrowcliffe)

    Marking resolved

    Plugin Author Pexle Chris

    (@pexlechris)

    I will release an update with the fix soon. Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp-login.php logout with redirect no longer works when library-viewer is active’ is closed to new replies.