Mobile database data migration from backend
Overview
At first it was thought to trigger Mobile database data migration from Auth0 login migration Action, but this requires to keep current login mutation to support username and password customer login.
As probably the most desired option in New Mobile Backend authentication is to get rid from login mutation, It won't be possible to authenticate the customer from Auth0 login migration action into Mobile Backend. That is because in Auth0 login migration action we only have access to username and password credentials but not yet to user's Auth0 token.
Limitations
- It is not possible from Auth0 login migration action to authenticate into Mobile Backend with user's Auth0 token as it is not available yet.
- We want Mobile Backend to stop allowing authentication with user's username and password, as we want to rely on Auth0 tokens.
Proposal
Migration can be done calling Auth0 from Mobile Backend and updating user's metadata.
In Mobile Backend create user mutation or injetUserToContext described in New Mobile Backend authentication we can add a step to check if Auth0 user's metadata contains user's Mobile Backend uid and if not, update user metadata to set Mobile Backend related data: Customer migration from mobile db
