Skip to content

Commit

Permalink
Merge pull request #115 from supertokens/feat/oauth2/base
Browse files Browse the repository at this point in the history
feat!: add the OAuth2 recipe
  • Loading branch information
porcellus authored Oct 3, 2024
2 parents cf3a931 + a975730 commit 01a1854
Show file tree
Hide file tree
Showing 64 changed files with 1,626 additions and 125 deletions.
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.15.0] - 2024-10-07

- Added the OAuth2Provider recipe

### Breaking changes

- Added a new `shouldTryLinkingToSessionUser` flag to sign in/up related function inputs:
- No action is needed if you are not using MFA/session based account linking.
- If you are implementing MFA:
- Plase set this flag to `false` (or leave as undefined) during first factor sign-ins
- Please set this flag to `true` for secondary factors.
- Please forward this flag to the original implementation in any of your overrides.
- Changed functions:
- `EmailPassword.signIn`, `EmailPassword.signUp`: both override and callable functions
- `ThirdParty.getAuthorisationURLWithQueryParamsAndSetState`: both override and callable function
- `Passwordless`:
- Functions overrides: `consumeCode`, `resendCode`, `createCode`, `setLoginAttemptInfo`, `getLoginAttemptInfo`
- Calling `createCode` and `setLoginAttemptInfo` take this flag as an optional input (it defaults to false)
- Changed the default implementation of `getTenantId` to default to the `tenantId` query parameter (if present) then falling back to the public tenant instead of always defaulting to the public tenant
- We now disable session based account linking in the magic link based flow in passwordless by default
- This is to make it function more consistently instead of only working if the link was opened on the same device
- You can override by overriding the `consumeCode` function in the Passwordless Recipe (see in the Migration guide section below for more information)

### Migration guide

#### Session based account linking for magic link based flows

You can re-enable linking by overriding the `consumeCode` function in the passwordless recipe and setting `shouldTryLinkingToSessionUser` to `true`.

```ts
Passwordless.init({
override: {
functions: (original) => {
return {
...original,
consumeCode: async (input) => {
// Please note that this is means that the session is required and will cause an error if it is not present
return original.consumeCode({ ...input, shouldTryLinkingWithSessionUser: true });
},
};
},
},
});
```

## [0.13.0] - 2024-07-10

### Breaking Changes
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/multifactorauth.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bundle/oauth2provider.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/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/totp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/website.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": ["2.0", "3.0"]
"versions": ["4.0"]
}
6 changes: 6 additions & 0 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.

28 changes: 18 additions & 10 deletions lib/build/recipe/emailpassword/index.js

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

16 changes: 14 additions & 2 deletions lib/build/recipe/emailpassword/recipeImplementation.js

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

6 changes: 6 additions & 0 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.

7 changes: 6 additions & 1 deletion lib/build/recipe/multitenancy/recipeImplementation.js

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

91 changes: 91 additions & 0 deletions lib/build/recipe/oauth2provider/index.d.ts

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

Loading

0 comments on commit 01a1854

Please sign in to comment.