Login and register saves user data to local storage