Revamps login to seperate login and authentication.
Fixes the warningless build