Redirect users to the Login or Register pages if they are not logged in.