Change login method in a more SPA way.