Support » Networking WordPress » how to redirect to login in WordPress multisite

  • blpraveen

    (@blpraveen)


    How to redirect to login when accessing a multisite.User should login before they go to the multisite page and authenticate based on multisite

    For Example
    Parent A has a child at School 1. So School 1 would direct them to go to http://www.kjp.net/store/school1 where they would need to create an account before they are able to view pricing for products 1a, 1b, 1c and services 1d and 1e.

    Parent B has a child at School 2. So School 2 would direct them to go to http://www.kjp.net/store/school2 where they would need to create an account before they are able to view pricing for products 2a, 2b, 2c and services 2d, 2e, and 2f.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I’m not sure I follow. I think you want a generic login page, lets say kjp.net/my-login/. Based on who logs in, WP would redirect that user to their associated school’s store. Is that right? WP would then need to know which school each user belongs to. If it’s always a 1 to 1 relationship, that’s not a problem.

    What about a parent with two kids, one in a different school than the other? How can WP know where to send them? I suppose in such cases they can be offered choice: School 1 for Adam, or School 2 for Alice.

    My approach would be to build a custom page template used only by the “my-login” page on the main site. When the user submits login credentials, after authentication, the template code can look up which sites/schools the user is registered for. If only one, immediately redirect them. If more than one, they are offered a choice before redirection.

    This could make initial self registration confusing for many since they must first know which school site to go to before they register. Then the parent of more than one child may need to register at multiple school sites to properly register for all their kids.

    Looking ahead, schools will change as their kids grow older. Not only will they need to register at a new school at some point, but they will probably want to abandon a previous school store where their kids no longer attend.

    Nothing insurmountable, but things to consider in designing a good UX. I can imagine a sort of mini-app to help parents get registered at the right sites without needlessly registering at the wrong ones. Ideally, they should pre-select the right schools and code will automatically register them for every pre-selected school at one time.

Viewing 1 replies (of 1 total)
  • The topic ‘how to redirect to login in WordPress multisite’ is closed to new replies.