-
Notifications
You must be signed in to change notification settings - Fork 94
feat: Experimental plugin support [v0.50.0] #909
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
base: 0.50
Are you sure you want to change the base?
Conversation
…method and enhance error handling for plugin version mismatches and duplicates
# Conflicts: # lib/build/emailpassword.js # lib/build/emailverification.js # lib/build/genericComponentOverrideContext.js # lib/build/index.js # lib/build/multifactorauth.js # lib/build/multitenancy.js # lib/build/oauth2provider.js # lib/build/passwordless.js # lib/build/passwordlessprebuiltui.js # lib/build/session.js # lib/build/thirdparty.js # lib/build/totp.js # lib/build/version.d.ts # lib/ts/version.ts # package-lock.json # package.json
# Conflicts: # lib/build/emailpassword-shared5.js # lib/build/genericComponentOverrideContext.js # lib/build/utils.d.ts # lib/ts/utils.ts # package-lock.json # package.json
feat: Add init method support, better support for dynamic route handlers and added support for exporting logic from plugins
return React.useContext(genericContext); | ||
const contextValue = React.useContext(genericContext); | ||
|
||
return { ...SuperTokens.getInstance()?.componentOverrides[key], ...contextValue }; |
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 code accesses componentOverrides[key]
on the result of SuperTokens.getInstance()
, which may return undefined
. This creates a potential null reference exception when SuperTokens hasn't been initialized yet. Consider using SuperTokens.getInstanceOrThrow()
instead, or add null checking with optional chaining:
return { ...(SuperTokens.getInstance()?.componentOverrides[key] || {}), ...contextValue };
This ensures the code handles the case when SuperTokens isn't initialized without throwing runtime errors.
return { ...SuperTokens.getInstance()?.componentOverrides[key], ...contextValue }; | |
return { ...(SuperTokens.getInstance()?.componentOverrides[key] || {}), ...contextValue }; |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
@@ -87,7 +86,6 @@ export default class Passwordless extends AuthRecipe< | |||
public readonly webJSRecipe: WebJSRecipeInterface<typeof PasswordlessWebJS> = PasswordlessWebJS | |||
) { | |||
super(config); | |||
this.recipeID = config.recipeId; | |||
|
|||
PostSuperTokensInitCallbacks.addPostInitCallback(() => { |
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.
Potential Bug: The line this.recipeID = config.recipeId;
was removed, which might affect recipe identification. The recipeID
property is declared in the base class and may need to be explicitly set from the config. Consider verifying that removing this assignment doesn't break the recipe identification logic, especially if there are cases where the static RECIPE_ID
value isn't sufficient.
PostSuperTokensInitCallbacks.addPostInitCallback(() => { | |
PostSuperTokensInitCallbacks.addPostInitCallback(() => { | |
this.recipeID = config.recipeId; |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
…egisterCredentialWithUser` method for user-specific credential registration
…base # Conflicts: # lib/build/webauthn.js
Summary of change
(A few sentences about this PR)
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
frontendDriverInterfaceSupported.json
file has been updated (if needed)package.json
package-lock.json
lib/ts/version.ts
npm run build-pretty
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.someFunc: function () {..}
).size-limit
section ofpackage.json
with the size limit set to the current size rounded up.rollup.config.mjs
lib/ts/types.ts
lib/ts/recipe/multifactorauth/types.ts
Remaining TODOs for this PR