fix of bug #368 Endless redirects or user doesn't exist with basic authe...

bug fixed in easiest way, tried to meet your code style.