A client uses the 'Login as user' behaviour to be able to see what users of the site are seeing, useful as it's an e-learning site and each user can see different content based on their progress. The users however, are only allowed to view the public site and not anything in the CP which means when the 'Login as user' is invoked the client is presented with the 'Unauthorized You don’t have the proper credentials to access this page' message.
Is this right? Looking through the code it seems the function
_handleSuccessfulLogin() is called and if the user cannot access the CP then they should be redirected to the
postLoginRedirect which in the case of this site is not set, so the user should be redirected to the homepage if I understand correctly.