Feat!: Account linking
Summary of change
The progress so far is that we have implemented and tested all recipe functions for account linking + verifyEmailForRecipeUserIfLinkedAccountsAreVerified interal function in the accountLinkingRecipe.go file.
There are also a few changes to existing recipes like thirdparty and email password to get the new tests to pass, however they need to be revisited.
Related issues
- https://github.com/supertokens/supertokens-core/issues/797
- https://github.com/supertokens/supertokens-node/pull/670
Test Plan
TODO
Documentation changes
TODO
Checklist for important updates
- [ ] Changelog has been updated
- [ ]
coreDriverInterfaceSupported.jsonfile has been updated (if needed)- Along with the associated array in
supertokens/constants.go
- Along with the associated array in
- [ ]
frontendDriverInterfaceSupported.jsonfile has been updated (if needed) - [ ] Changes to the version if needed
- In
supertokens/constants.go > version variable
- In
- [ ] Had installed and ran the pre-commit hook
- [ ] If new thirdparty provider is added,
- [ ] update switch statement in
recipe/thirdparty/providers/config_utils.gofile,createProviderfunction. - [ ] add an icon on the user management dashboard.
- [ ] update switch statement in
- [ ] Issue this PR against the latest non released version branch.
- To know which one it is, run find the latest released tag (
git tag) in the formatvX.Y.Z, and then find the latest branch (git branch --all) whoseX.Yis greater than the latest released tag. - If no such branch exists, then create one from the latest released branch.
- To know which one it is, run find the latest released tag (
- [ ] If access token structure has changed
- Modified test in
session/accessTokenVersions_test.goto account for any new claims that are optional or omitted by the core
- Modified test in
Remaining TODOs for this PR
- [ ] Confirm that functions / structs exposed by the supertokens package is not polluted by the account linking stuff.
- [ ] User pagination API works as expected on dashboard - even if the user has no first or last name (and if they do have too)
- [x] Add helper functions into getUsers recipe impl's user object
- [x] Test getUsers function
- [x] Check that user object JSONification is correct:
- [x] helper functions are not jsonified
- [x] the props that are inherited are not JSONinfied
- [x] properties that are missing (like phoneNumber can be in login method) are not present
- [x] Make sure that test files in test/unittesting are being run during CICD tests.
- [x] Expose createPrimaryUserId and canCreatePrimaryUserId functions + add tests for them.
- [ ] Remove convertEpUserToSuperTokensUser and convertTpUserToSuperTokensUser from the test files and replace all uses of it with simple assignment
- [x] Call verifyEmailForRecipeUserIfLinkedAccountsAreVerified in linkAccount recipe function.
- [ ] isVerified boolean in manuallyCreateOrUpdateUser and in signInUp needs to be properly implemented.
- [ ] Test for verifyEmailForRecipeUserIfLinkedAccountsAreVerified
- [x] Test for linkAccounts recipe function
- [ ] Changelog
- [ ] In
recipe/dashboard/api/userdetails/userDelete.go, we must fetchremoveAllLinkedAccountsfrom the API input, as opposed to passing in true all the time.
Additional notes:
- There is a local branch on @rishabhpoddar machine in node repo called
account-linking-golang-track-keeping-local-branchwhich has been modified to remove tests that have been implemented in the golang SDK. This way, we can keep track of which tests are pending to be implemented -This PR has files that are unviewed (from @rishabhpoddar account) which indicate that there is something from that file thats not implemented in golang already.
Hello!
Is there any update planned on this feature? Based on your documentation, it's the first step toward new MFA in the Golang SDK. I would really appreciate having this feature, as MFA is almost a must have in today products.
Is there anything we can do to speed up the process ?
Any update on this?
still no update? 🥲