Refactor login command

[Finishes #67149590]