Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat!: Account linking #391

Draft
wants to merge 31 commits into
base: 0.17
Choose a base branch
from
Draft

Feat!: Account linking #391

wants to merge 31 commits into from

Conversation

rishabhpoddar
Copy link
Contributor

@rishabhpoddar rishabhpoddar commented Dec 8, 2023

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

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)
  • Add helper functions into getUsers recipe impl's user object
  • Test getUsers function
  • Check that user object JSONification is correct:
    • helper functions are not jsonified
    • the props that are inherited are not JSONinfied
    • properties that are missing (like phoneNumber can be in login method) are not present
  • Make sure that test files in test/unittesting are being run during CICD tests.
  • 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
  • Call verifyEmailForRecipeUserIfLinkedAccountsAreVerified in linkAccount recipe function.
  • isVerified boolean in manuallyCreateOrUpdateUser and in signInUp needs to be properly implemented.
  • Test for verifyEmailForRecipeUserIfLinkedAccountsAreVerified
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant