fixes #113 - 401 now redirects back to the previous location after login