fix login with empty 'next' value