• Resolved Chriber

    (@chriber)


    Hi,
    I just tried to use the Force Login plugin on a multisite, but there was always a forward to the WP backend and when we tried to “visit page” we were redirected to the login page. Infinite loop 🙁

    The multisite is something like “xyz.bla.com”
    The subsite is like “abc.xyz.bla.com”
    where also a domain mapping “abcdef.ch” is active (realised with plugin WordPress MU Domain Mapping)

    So neither “abc.xyz.bla.com” nor “abcdef.ch” was possible to view with your plugin active…

    Any idea what’s wrong?

    Thanks in advance

    https://wordpress.org/plugins/wp-force-login/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Kevin Vess

    (@kevinvess)

    I would guess it’s not working well with the WordPress MU Domain Mapping plugin you’re also using. Have you tried deactivating that other plugin to see if Force Login works then?

    I just tried to use the Force Login plugin on a multisite, but there was always a forward to the WP backend and when we tried to “visit page” we were redirected to the login page.

    The plugin redirects you to the login page if you’re not already logged-in – sounds like it is working or for whatever reason, doesn’t think you’re actually logged-in.

    Infinite loop 🙁

    Are you actually getting an infinite loop message from the browser or do you mean you keep being sent to the login screen because it doesn’t think you’re logged-in?

    Thread Starter Chriber

    (@chriber)

    As suggested I switched off the WordPress MU Domain Mapping plugin and your plugin worked. So it seems to be compatible to Multisite, but not to the domain mapping.

    By infinite loop I meant:

    -> login on the mapped domain “abcdef.ch”
    -> being sent to backend of abc.xyz.bla.com
    -> click view site
    -> being sent back to login on “abcdef.ch”
    -> and so on…

    So any idea why the plugin seems to think that I’m not logged in?

    Plugin Author Kevin Vess

    (@kevinvess)

    Right, so you’re stuck in a loop, but not an infinite loop, you stop on the login screen.

    An infinite loop (or endless loop) is a sequence of instructions in a computer program which loops endlessly, either due to the loop having no terminating condition, having one that can never be met, or one that causes the loop to start over.

    http://www.google.com/#q=infinite+loop+definition

    Based on the description of the loop you’re stuck in, it sounds like this is only an issue when viewing the frontend of the site; I think the problem is Force Login doesn’t know you’re logged-in when trying to view the referring domain (“abcdef.ch”) instead of the configured domain (“abc.xyz.bla.com”).

    Force Login uses the builtin WordPress function is_user_logged_in() to determine if you’re viewing the site as a logged-in user.
    https://codex.wordpress.org/Function_Reference/is_user_logged_in

    You might want to check with the other plugin creators as to why the is_user_logged_in() function not considering you as logged-in while viewing the mapped domain.

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