toDevice functional, logging in a user now stores its devices in cache