Changed login method to use loginById.