Skip to content

Commit

Permalink
Merge pull request #97 from supertokens/feat/account-linking
Browse files Browse the repository at this point in the history
feat: update interfaces to match new FDI
  • Loading branch information
rishabhpoddar authored Sep 19, 2023
2 parents 7f95fc0 + f61d30d commit 16882a1
Show file tree
Hide file tree
Showing 59 changed files with 1,132 additions and 353 deletions.
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.8.0] - 2023-XX-XX

### Overview

#### Introducing account-linking

With this release, we are introducing AccountLinking, this will let you:

- link accounts automatically,
- implement manual account linking flows.

Check our [guide](https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/account-linking/overview) for more information.

To use this you'll need compatible versions:

- Core>=7.0.0
- supertokens-node>=16.0.0 (support is pending in other backend SDKs)
- supertokens-website>=17.0.3
- supertokens-web-js>=0.8.0
- supertokens-auth-react>=0.35.0

### Breaking changes

- Added support for FDI 1.18 (Node SDK>= 16.0.0), but keeping support FDI version1.17 (node >= 15.0.0, golang>=0.13, python>=0.15.0)
- User type has changed across recipes and functions: recipe specific user types have been removed and replaced by a generic one that contains more information
- `createdNewUser` has been renamed to `createdNewRecipeUser`
- `createCode`, `consumeCode`, `createPasswordlessCode` and `consumePasswordlessCode` can now return status: `SIGN_IN_UP_NOT_ALLOWED`
- `signInAndUp` and `thirdPartySignInAndUp` can now return new status: `SIGN_IN_UP_NOT_ALLOWED`
- `sendPasswordResetEmail` can now return `status: "PASSWORD_RESET_NOT_ALLOWED"`
- `signIn` and `emailPasswordSignIn` can now return `SIGN_IN_NOT_ALLOWED`
- `signUp` and `emailPasswordSignUp` can now return `SIGN_UP_NOT_ALLOWED`

### Migration

#### New User structure

We've added a generic `User` type instead of the old recipe specific ones. The mapping of old props to new in case you are not using account-linking:

- `user.id` stays `user.id`
- `user.email` becomes `user.emails[0]`
- `user.phoneNumber` becomes `user.phoneNumbers[0]`
- `user.thirdParty` becomes `user.thirdParty[0]`
- `user.timeJoined` is still `user.timeJoined`
- `user.tenantIds` is still `user.tenantIds`

#### Checking if a user signed up or signed in

- When calling passwordless consumeCode / social login signinup APIs, you can check if a user signed up by:

```
// Here res refers to the result the function/api functions mentioned above.
const isNewUser = res.createdNewRecipeUser && res.user.loginMethods.length === 1;
```

- When calling the emailpassword sign up API, you can check if a user signed up by:

```
const isNewUser = res.user.loginMethods.length === 1;
```

## [0.7.3] - 2023-08-21

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion bundle/emailpassword.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/emailverification.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/multitenancy.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/passwordless.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/session.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/supertokens.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/thirdparty.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/thirdpartyemailpassword.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/thirdpartypasswordless.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/userroles.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontendDriverInterfaceSupported.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_comment": "contains a list of frontend-backend interface versions that this package supports",
"versions": ["1.17"]
"versions": ["1.17", "1.18"]
}
32 changes: 27 additions & 5 deletions lib/build/recipe/emailpassword/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/build/recipe/emailpassword/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 56 additions & 9 deletions lib/build/recipe/emailpassword/recipeImplementation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 23 additions & 8 deletions lib/build/recipe/emailpassword/types.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 16882a1

Please sign in to comment.