amplify lib can mutate user object itself and it will lead to vuex error that state mutated from outside of actions. It could be avoided using Object.assing but there 2
nuxt will warn if vuex object not fully serializable e.g. non POJO nuxt/nuxt.js#4046
It is need for custom auth flow e.g. passwordless https://aws-amplify.github.io/docs/js/authentication#using-a-custom-challenge Also converts user to POJO object, because otherwise with simple assignment there will be two problems
amplify lib can mutate user object itself and it will lead to vuex error that state mutated from outside of actions. It could be avoided using Object.assing but there 2 nuxt will warn if vuex object not fully serializable e.g. non POJO nuxt/nuxt.js#4046