-
Notifications
You must be signed in to change notification settings - Fork 84
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 #670
Conversation
* account linking changes * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/session/sessionClass.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/session/sessionFunctions.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * code review changes * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * code review changes * code review changes * code review changes * code review changes * code review changes * Update lib/ts/recipe/session/sessionFunctions.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes Co-authored-by: Rishabh Poddar <[email protected]>
* EP recipe interface changes regarding account-linking * Update lib/ts/recipe/emailpassword/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/emailpassword/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/emailpassword/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * Update lib/ts/recipe/emailpassword/api/implementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/emailpassword/api/implementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/emailpassword/api/implementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/emailpassword/api/implementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/emailpassword/api/implementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/emailpassword/api/implementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * Update lib/ts/recipe/emailpassword/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/thirdpartyemailpassword/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes Co-authored-by: Rishabh Poddar <[email protected]>
* thirdparty interface changes regarding account-linking * Update lib/ts/recipe/thirdparty/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * code review changes Co-authored-by: Rishabh Poddar <[email protected]>
* passwordless interface changes for account linking * code review changes
* recipe interface changes for account linking * user context update * types update * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> Co-authored-by: Rishabh Poddar <[email protected]>
* recipe interface changes for account linking * account linking implementation * user context update * code udpate * types update * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * return type update * index file updated * merge with account-linking interface * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * code review changes * code review changes * code review changes * review changes * recipeImplementation types update * merge with 13.0 * recipe implementation update * changes to dashboard recipe types * removes unnecessary functions exposed from account linking recipe * adds a precautionary check * small change * Update lib/ts/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/index.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/supertokens.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/dashboard/api/usersGet.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/index.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/index.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/index.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * mark email as verify if it is already verified in either primary user or the current recipe user * fixes and refactors * account linking: fixes bugs and refactors (#498) * fixes bugs and refactors * small refactors and fixes * small refactor * small type changes * review changes * removes redundant check * account linking: removes ANOTHER from canCreatePrimaryUserId status return type (#500) * removes ANOTHER from canCreatePrimaryUserId status return type * small change related to status change in primary user id creation * change to canLinkAccounts * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes --------- Co-authored-by: Rishabh Poddar <[email protected]>
* Refactor status * Refactor unlink accounts return type * Move marking emails as verified logic to link accounts * Refactor * Rename ACCOUNT_INFO_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR * fixes review comments --------- Co-authored-by: rishabhpoddar <[email protected]>
* recipe interface changes for account linking * account linking implementation * user context update * code udpate * types update * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * return type update * index file updated * merge with account-linking interface * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * code review changes * code review changes * code review changes * review changes * sign-up post login updated * sign-up post login updated * sign-up API implementation update * import update * function import update * changes in signup recipeimplementation * recipeImplementation types update * merge with 13.0 * merge with account-linking implementation * recipe implementation update * account linking claim * changes to dashboard recipe types * removes unnecessary functions exposed from account linking recipe * adds a precautionary check * small change * Update lib/ts/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/index.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/supertokens.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/dashboard/api/usersGet.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/index.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/index.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/index.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * mark email as verify if it is already verified in either primary user or the current recipe user * fixes and refactors * account linking: fixes bugs and refactors (#498) * fixes bugs and refactors * small refactors and fixes * small refactor * small type changes * review changes * removes redundant check * account linking: removes ANOTHER from canCreatePrimaryUserId status return type (#500) * removes ANOTHER from canCreatePrimaryUserId status return type * small change related to status change in primary user id creation * change to canLinkAccounts * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * review changes * createdNewUser changes * adds comments * fixes * review changes (#511) * more changes * small changes * small changes * small changes * Update lib/ts/recipe/emailpassword/api/implementation.ts * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * more fixes - ts still not compiling * fixes all ts issues --------- Co-authored-by: Rishabh Poddar <[email protected]>
* email verification recipe changes for account linking * email verification recipe changes for account linking * email verification recipe changes for account linking * recipe interface changes for account linking * account linking implementation * user context update * code udpate * types update * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/types.ts Co-authored-by: Rishabh Poddar <[email protected]> * return type update * index file updated * merge with account-linking interface * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * Update lib/ts/recipe/accountlinking/recipeImplementation.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * Update lib/ts/recipe/accountlinking/recipe.ts Co-authored-by: Rishabh Poddar <[email protected]> * code review changes * code review changes * code review changes * code review changes * review changes * sign-up post login updated * sign-up post login updated * sign-up API implementation update * updating email verification api implementation * import update * function import update * changes in signup recipeimplementation * email verify get changes * recipeImplementation types update * merge with 13.0 * merge with account-linking implementation * merge with 13.0 * recipe implementation update * account linking claim * session claim update * session claim update * merges with latest * more changes * more changes * removes account linking claim post linkAccounts or createPrimaryUser function call * refactor * small change * small change * exposes help functions in account linking recipe * refactor and works on generate email verification token API * completes generate email verification token API * adds todos * more changes * refactor * removes unnecessary function from recipes * resolves a few todos * fixes dashboard api for email verification * fixes an issue where we tried linking account even in email verify get API * adds account linking in very email recipe function --------- Co-authored-by: Rishabh Poddar <[email protected]>
* gets tests to run * resets account linking between tests * fixes a test * adds mocking for a few APIs * more fixes * fixes more bugs * fixes a test * fixes more tests * fixes a small bug * enforces normlised checks when comparing account info in logic * fixes a test * fixes a few more tests * fixes more tests * fixes more tests * fixes more tests * more test fixes * more test fixes * more change * fixes more tests * more changes * adds id and recipeId to email verification sendEmail function * test fix * fixes more tests * fixes more tests * fixes more tests * more test fixes * fixes more tests * fixes more tests * fixes more tests * more test fixes * fixes more tests * more test fixes * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * small change to a test * fixes more tests * fixes more tests * some type changes * fixes cyclic dependency test * edits github acount to allow mocking
* WIP - fixes a few bugs, and adds adds the concept of a recipeUserId type * gets everything to compile * modifies tests * fixes tests * fixes more tests * fixes more tests * fixes more tests * fixes a test * fixes more tests * fixes more tests * fixes more tests * fixes more tests and adds a toJson function in the user object to convert recipe user id object type to a string in the json response * fixes more tests * fixes issue with allowing emial password sign up for a primary email * renames an API function name * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests
* removes unnecessary recipe functions * adds primary user creation test' * adds test todos * adds test todos * adds more tests * adds more tests * adds more tests * more tests * more tests * more tests * adds more tests * more mocking * more tests * more tests * adds more tests * removes normalisedInputMap structure * more tests * adds more tests * changes impl of does email exist * more tests * adds more tests * adds more tests * more changes * adds auto marking of email verification based on linking * adds more tests * more tests * remove a todo * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * fixes a bug + adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * changes path of API * small changes to dashboard related APIs * fixes a bug and adds more tests * adds more tests * adds more tests * more tests * more tests * adds more tests * adds more tests * adds more tests * adds more tests and adds recipe user id to password reset email send email function * moves check for isSignUpAllowed to api layer * renames a variable * adds more checks to allowSignUp function * modifies update email or password function * more tests * more tests * adds comments * adds more tests * adds more tests * adds comments * adds test cases skeleton * adds one test for password reset * adds more tests * adds more tests * adds more tests * more tests * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * adds more tests * enhances tests * starts working on session tests * fixes a test * adds more tests * adds more tests * renames a function * adds more tests * more tests * adds more tests * adds more tests * adds a TODO * adds more tests * removes unnecessary call to a function in email verification recipe * adds more tests * add new tests * add new tests * adds more tests * adds more tests * adds more tests
* removes use of account linking claim * starts working on modifying tests * changes output of one API * changes output of an API * modifies tests * fixes tests * fixes tests * fixes tests * fixes more tests
* starts working on type changes * makes more progress * refactors a lot of code * gets everything to compile * starts fixing tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * fixes more tests * removes unnecessary code * fixes more tests * fixes more tests * fixes more tests * more tests * adds more checks * more tests * adds more tests * more tests * removes unnecessary code * adds more tests * changes status type to make it more clear * adds new param to listUsersByAccountInfo * more changes * adds more tests * fixes an issue * adds more comments * more changes * more changes * more changes * more changes * fixes a test * changes * changes * changes * adds comments and tests * adds more tests * renames a var * modifies API spec a bit * adds more tests * adds more tests * removes post sessison account linking API but keeps the function * adds a few more checks * fixes a few bugs * fixes tests * removes unneeded check
…or email verification (#584) * adds missing checks * more changes * adds function for isSignInAllowed * adds isEmailVerified function * more refactor * adds a TODO * more changes * completes more todos * finishes more todos * adds account linking during sign in as well * more refactors * changes a comment * small changes * fixes a cyclic dependency issue * fixes a test * fixes tests * fixes a bug * more test fixes * more changes * fixes tests * fixes more tests * more changes * fixes tests * adds a new test * bug fixes * fixes cyclic dependency issues * more fixes * adds more tests * adds more tests * adds a comment * adds more tests * more tests * more changes * more tests * adds tests and fixes a bug * adds more tests * adds more tests * adds more tests * adds more tests * more tests * adds more tests
…node into account-linking
CHANGELOG.md
Outdated
|
||
- Now only supporting CDI 4.0 | ||
- Now supporting FDI 1.18 | ||
- removed the recipe specific `User` type, now all functions are using the new generic `User` type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- removed the recipe specific `User` type, now all functions are using the new generic `User` type | |
- Removed the recipe specific `User` type, now all functions are using the new generic `User` type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also link to this page: supertokens.com/docs/thirdpartyemailpassword/user-object
CHANGELOG.md
Outdated
|
||
- You can check if a new primary user was created by `EmailPassword.signUp`, `signUpPOST` or `createNewRecipeUser` (and their ThirdParyEmailPassword counterparts) by: | ||
|
||
``` | ||
const isNewPrimaryUser = res.user.loginMethod.length === 1; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh? Not sure why this is needed. Did you mean that you can check if a new user signed in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is different from the above, since EP signup doesn't have createdNewRecipeUser
// ... | ||
}); | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to have a section on frontend / core migration needed - that these are the versions of the frontend and core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The supported FE version didn't change if you are not using account linking, and the core is mentioned above. I can add a section/link here pointing to the account linking recipe docs.
export function isAnIpAddress(ipaddress: string) { | ||
return /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( | ||
ipaddress | ||
); | ||
} | ||
|
||
export function getBackwardsCompatibleUserInfo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(do not resolve this comment) the implementation of this function has changed slightly in this PR: #749
Summary of change
Account linking
Related issues
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Documentation changes
(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)
Checklist for important updates
coreDriverInterfaceSupported.json
file has been updated (if needed)lib/ts/version.ts
frontendDriverInterfaceSupported.json
file has been updated (if needed)package.json
package-lock.json
lib/ts/version.ts
npm run build-pretty
recipe/thirdparty/providers/configUtils.ts
file,createProvider
function.git tag
) in the formatvX.Y.Z
, and then find the latest branch (git branch --all
) whoseX.Y
is greater than the latest released tag.add-ts-no-check.js
file to include thatsomeFunc: function () {..}
).Remaining TODOs for this PR
Summary by CodeRabbit
Release Notes:
createAndSendEmailUsingSupertokensService
function inpasswordResetFunctions.js
to use async/await syntax and added log messages for success and error scenarios.User
type inpasswordResetFunctions.d.ts
and replaced it with an inline type definition.recipe.d.ts
, updated the import statements forBaseRequest
andBaseResponse
to use thetype
keyword and removed thegetEmailForUserId
property from the class.