Redirect to login refactored, closes #62