Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rishabh Poddar <[email protected]>
  • Loading branch information
porcellus and rishabhpoddar authored Sep 16, 2023
1 parent 68c4803 commit 340d80f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Breaking changes

- Now only supporting CDI 4.0
- Now only supporting CDI 4.0. Compatible with core version >= 7.0
- Now supporting FDI 1.18
- removed the recipe specific `User` type, now all functions are using the new generic `User` type
- The `fetchValue` callback of claims now take a new `recipeUserId` param
- Now ignoring protected props in the payload in `createNewSession` and `createNewSessionWithoutRequestResponse`
- `createdNewUser` has been renamed to `createdNewRecipeUser` in sign up related APIs and functions

- EmailPassword:
- removed `getUserById`, `getUserByEmail`
- added `consumePasswordResetToken`
- added an overrideable `createNewRecipeUser` function that is called during sign up and in the “invitation link” flow
- removed `getUserById`, `getUserByEmail`. You should use `supertokens.getUser`, and `supertokens. listUsersByAccountInfo` instead
- added `consumePasswordResetToken`. This function allows the consumption of the reset password token without changing the password. It will return OK if the token was valid.
- added an overrideable `createNewRecipeUser` function that is called during sign up and password reset flow (in case a new email password user is being created on the fly). This is mostly for internal use.
- `recipeUserId` is added to the input of `getContent` of the email delivery config
- `email` was added to the input of `createResetPasswordToken` , `sendResetPasswordEmail`, `createResetPasswordLink`
- `updateEmailOrPassword` :
Expand Down Expand Up @@ -147,13 +147,13 @@ We've added a generic `User` class instead of the old recipe specific ones. The

Some functions now require you to pass a `RecipeUserId` instead of a string user id. If you are using our auth recipes, you can find the recipeUserId as: `user.loginMethods[0].recipeUserId` (you'll need to worry about selecting the right login method after enabling account linking). Alternatively, if you already have a string user id you can convert it to a `RecipeUserId` using `supertokens.convertToRecipeUserId(userIdString)`

#### Checking if a new primary user was created
#### Checking if a user signed up or signed in

- You can check if a new primary user created by `ThirdParty.manuallyCreateOrUpdateUser`, `signInUp`, `signInUpPOST`, `Passwordless.consumeCode` or `consumeCodePOST` (and their combination recipe counterparts):
- In the emailpassword sign up / 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 isNewPrimaryUser = res.createdNewRecipeUser && res.user.loginMethod.length === 1;
const isNewUser = res.createdNewRecipeUser && res.user.loginMethod.length === 1;
```

- You can check if a new primary user was created by `EmailPassword.signUp`, `signUpPOST` or `createNewRecipeUser` (and their ThirdParyEmailPassword counterparts) by:
Expand Down

0 comments on commit 340d80f

Please sign in to comment.