supertokens-golang icon indicating copy to clipboard operation
supertokens-golang copied to clipboard

Feat!: Account linking

Open rishabhpoddar opened this issue 2 years ago • 1 comments

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.json file has been updated (if needed)
    • Along with the associated array in supertokens/constants.go
  • [ ] frontendDriverInterfaceSupported.json file has been updated (if needed)
  • [ ] Changes to the version if needed
    • In supertokens/constants.go > version variable
  • [ ] Had installed and ran the pre-commit hook
  • [ ] If new thirdparty provider is added,
    • [ ] update switch statement in recipe/thirdparty/providers/config_utils.go file, createProvider function.
    • [ ] add an icon on the user management dashboard.
  • [ ] 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 format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.
  • [ ] If access token structure has changed
    • Modified test in session/accessTokenVersions_test.go to account for any new claims that are optional or omitted by the core

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 fetch removeAllLinkedAccounts from 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-branch which 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.

rishabhpoddar avatar Dec 08 '23 07:12 rishabhpoddar

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 ?

RomainJolidon avatar Feb 14 '25 09:02 RomainJolidon

Any update on this?

trivialkettle avatar Apr 08 '25 09:04 trivialkettle

still no update? 🥲

sneakykiwi avatar Jun 07 '25 14:06 sneakykiwi