refactor sdk login