-
Notifications
You must be signed in to change notification settings - Fork 0
Handle signup & signin utm codes #388
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
Conversation
| fullFooter = prevContext.toolConfig?.fullFooter, | ||
| showSalesCta = prevContext.toolConfig?.showSalesCta, | ||
| profileCompletionData = prevContext.auth?.profileCompletionData, | ||
| signupUtmCodes = prevContext.signupUtmCodes, |
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.
[correctness]
Consider adding a default value for signupUtmCodes to handle cases where prevContext.signupUtmCodes is undefined. This can prevent potential runtime errors if the value is used without checking for its existence.
| showSalesCta = prevContext.toolConfig?.showSalesCta, | ||
| profileCompletionData = prevContext.auth?.profileCompletionData, | ||
| signupUtmCodes = prevContext.signupUtmCodes, | ||
| simplifiedNav = prevContext.simplifiedNav, |
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.
[correctness]
Consider adding a default value for simplifiedNav to handle cases where prevContext.simplifiedNav is undefined. This can prevent potential runtime errors if the value is used without checking for its existence.
| const signupUrl = [ | ||
| `${AUTH0_AUTHENTICATOR_URL}?retUrl=${encodeURIComponent(locationHref)}`, | ||
| signup === true ? '&mode=signUp' : '', | ||
| $ctx.signupUtmCodes, |
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.
[❗❗ security]
Ensure that $ctx.signupUtmCodes is properly sanitized and validated to prevent potential injection attacks or malformed URLs. If this value is user-controlled or comes from an external source, it could pose a security risk.
| menuItems={menuItems} | ||
| isMobile={$isMobile} | ||
| navigationHandler={navigationHandler} | ||
| simplifiedNav={$ctx.simplifiedNav} |
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.
[❗❗ correctness]
Ensure that $ctx.simplifiedNav is properly initialized and has a default value in case it is not set in the context. This will prevent potential runtime errors if the context does not provide this value.
| fullFooter: any; | ||
| showSalesCta: any; | ||
| }; | ||
| signupUtmCodes: any; |
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.
[maintainability]
Consider specifying a more precise type than any for signupUtmCodes. Using any can lead to runtime errors and makes the code harder to maintain.
| showSalesCta: any; | ||
| }; | ||
| signupUtmCodes: any; | ||
| simplifiedNav: any; |
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.
[maintainability]
Consider specifying a more precise type than any for simplifiedNav. Using any can lead to runtime errors and makes the code harder to maintain.
| toolConfig: ToolConfig; | ||
| navigationHandler: NavigationHandler; | ||
| supportMeta?: SupportMeta; | ||
| signupUtmCodes?: string; |
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.
[correctness]
Consider validating the format of signupUtmCodes to ensure it meets expected URL parameter standards. This can prevent potential issues with malformed URLs.
Accept new config fields: