Changed login method to a gem.