Skip to content

Commit

Permalink
copy change to account linking migration text
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Dec 14, 2023
1 parent 2996ddf commit 7066b63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ If enabling automatic account linking for **an existing user base**, then before

To do this, you should create a script that:
- [Loops through all users](../user-pagination) in your app (oldest first).
- For each user, fetch the user's ID and call the [create primary user](./manual-account-linking#creating-a-primary-user) function on them.
- For each user, fetch the user's ID and call the [create primary user](./manual-account-linking#creating-a-primary-user) function on them **if their email is verified**.
- If at any point, you find that primary user creation failed because of `ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR` error, then it means that there is already another user with the same email / phone number that is already a primary user. In this case, you don't need to take any action for the current user (that failed) since they will be auto linked to the existing user when they sign in next with this method. As a side effect of this, their primary user ID will change when their account will be linked. To do any data migration at this point, see [this section on this page](#migration-of-user-data-when-accounts-are-linked).
- If you have two users with the same email / phone number, you can even pick which one of them will become a primary user based on your own logic. For example, instead of just making the oldest user the primary user, you can choose the one that has more activity on your app.
- You can also do the above via [direct API calls to the core](https://app.swaggerhub.com/apis/supertokens/CDI).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ If enabling automatic account linking for **an existing user base**, then before

To do this, you should create a script that:
- [Loops through all users](../user-pagination) in your app (oldest first).
- For each user, fetch the user's ID and call the [create primary user](./manual-account-linking#creating-a-primary-user) function on them.
- For each user, fetch the user's ID and call the [create primary user](./manual-account-linking#creating-a-primary-user) function on them **if their email is verified**.
- If at any point, you find that primary user creation failed because of `ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR` error, then it means that there is already another user with the same email / phone number that is already a primary user. In this case, you don't need to take any action for the current user (that failed) since they will be auto linked to the existing user when they sign in next with this method. As a side effect of this, their primary user ID will change when their account will be linked. To do any data migration at this point, see [this section on this page](#migration-of-user-data-when-accounts-are-linked).
- If you have two users with the same email / phone number, you can even pick which one of them will become a primary user based on your own logic. For example, instead of just making the oldest user the primary user, you can choose the one that has more activity on your app.
- You can also do the above via [direct API calls to the core](https://app.swaggerhub.com/apis/supertokens/CDI).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ If enabling automatic account linking for **an existing user base**, then before

To do this, you should create a script that:
- [Loops through all users](../user-pagination) in your app (oldest first).
- For each user, fetch the user's ID and call the [create primary user](./manual-account-linking#creating-a-primary-user) function on them.
- For each user, fetch the user's ID and call the [create primary user](./manual-account-linking#creating-a-primary-user) function on them **if their email is verified**.
- If at any point, you find that primary user creation failed because of `ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR` error, then it means that there is already another user with the same email / phone number that is already a primary user. In this case, you don't need to take any action for the current user (that failed) since they will be auto linked to the existing user when they sign in next with this method. As a side effect of this, their primary user ID will change when their account will be linked. To do any data migration at this point, see [this section on this page](#migration-of-user-data-when-accounts-are-linked).
- If you have two users with the same email / phone number, you can even pick which one of them will become a primary user based on your own logic. For example, instead of just making the oldest user the primary user, you can choose the one that has more activity on your app.
- You can also do the above via [direct API calls to the core](https://app.swaggerhub.com/apis/supertokens/CDI).
Expand Down

0 comments on commit 7066b63

Please sign in to comment.