Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @noellesteegs, after logging in, the user will be redirected to the last page he/she visits, or the Admin page if that user went directly to the login page. Can you please test by deactivating all plugins except RSA, then switch back to the default theme to see if RSA causes the issue?

    Thread Starter Noelle Steegs

    (@noellesteegs)

    Hi @dinhtungdu,

    Thanks for the reply.

    I have deactivated all plugins except Restricted Site Access, amr shortcode any widget and bbPress – the latter two are required for the login form. I have also switched to Twentytwenty.

    The issue persists.

    How else can I help to troubleshoot?

    So you mean that after logging in (with correct credentials), the user gets redirected to the login page again with username and password fields?

    > How else can I help to troubleshoot?
    A screen cast or some screenshots would definitely help.

    Thread Starter Noelle Steegs

    (@noellesteegs)

    No, I mean that after logging in with correct credentials, the user gets redirected to the login page again with a badge showing the user is logged in.

    I have recorded a screencast: https://screencast-o-matic.com/u/inNS/rsa.

    @noellesteegs I can reproduce your issue now. I recommend using https://wordpress.org/plugins/peters-login-redirect/ to control the redirect URL after login.

    Thread Starter Noelle Steegs

    (@noellesteegs)

    Hi @dinhtungdu, unfortunately that plugin didn’t work BUT after a lot of trial and error the following snippet ended up working for me:

    // Redirect to homepage after login
    function login_redirect( $redirect_to, $request, $user ){
        wp_redirect( get_option('siteurl') );
    }
    add_filter( 'login_redirect', 'login_redirect', 10, 3 );

    Thanks for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Redirect after login’ is closed to new replies.