Closed peterphanouvong closed 1 week ago
The recent updates improve configuration management and error handling across the authentication and routing modules. Key enhancements include standardizing functions to use an options object for configuration details, updating redirection logic, and introducing new configuration types. These changes ensure more structured, reliable, and maintainable code by centralizing configuration details and improving error validation.
File Path | Change Summary |
---|---|
src/handlers/auth.js |
Updated function parameters to expect an options object and enhanced error handling logic. |
src/handlers/callback.js |
Modified redirection logic to use postLoginRedirectURL and routerClient.clientConfig.siteUrl . |
src/routerClients/AppRouterClient.js |
Introduced a more detailed options object and updated clientConfig initialization. |
src/routerClients/PagesRouterClient.js |
Changed constructor parameter from clientOptions to options and updated clientConfig initialization. |
src/routerClients/RouterClient.js |
Added a new clientConfig property of type KindeClientConfig to the RouterClient class. |
types.d.ts |
Added a new KindeClientConfig type detailing client configuration properties. |
sequenceDiagram
participant User
participant AppRouterClient
participant CallbackHandler
User ->> AppRouterClient: Request login
AppRouterClient ->> CallbackHandler: Redirect with postLoginRedirectURL
CallbackHandler ->> User: Redirected based on config.redirectURL
sequenceDiagram
participant User
participant AppRouterClient
participant CallbackHandler
User ->> AppRouterClient: Request login
AppRouterClient ->> CallbackHandler: Redirect with postLoginRedirectURL
CallbackHandler ->> User: Redirected based on routerClient.clientConfig.siteUrl
sequenceDiagram
participant Request
participant AppRouterClient
participant KindeServerClient
Request ->> AppRouterClient: Instantiate with options
AppRouterClient ->> AppRouterClient: Initialize clientConfig
AppRouterClient ->> KindeServerClient: create with clientConfig
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Explain your changes
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.