Closed peterphanouvong closed 2 weeks ago
The recent updates primarily focus on enhancing error handling and configurability within various parts of the system. These changes include adding error handling logic, introducing a new options
parameter for added flexibility, and updating constructors to manage this new parameter. These improvements ensure that errors are caught and handled more gracefully, making the software more resilient and adaptable.
Files | Summary |
---|---|
src/handlers/auth.js |
- Added import for config . - Introduced options parameter in the exported function. - Environment variable validation and options passing within the function. - Added onError in options for appRouterHandler . |
src/handlers/callback.js |
Added error handling logic to manage errors during specific operations, providing fallback responses if errors occur. |
src/routerClients/AppRouterClient.js |
Updated constructor to accept options parameter, including onError callback for error handling. |
src/routerClients/RouterClient.js |
Minor formatting changes in the constructor and added onError() method that needs to be implemented. |
sequenceDiagram
participant User
participant AuthHandler
participant Config
participant AppRouterClient
participant RouterClient
User->>AuthHandler: Initiates Authentication
AuthHandler->>Config: Load Configuration
AuthHandler->>AppRouterClient: Pass options including onError
AppRouterClient->>RouterClient: Pass options including onError
RouterClient->>RouterClient: Handle operation
RouterClient->>RouterClient: onError if error occurs
RouterClient->>AppRouterClient: Result or Error Callback
AppRouterClient->>AuthHandler: Result or Error Callback
AuthHandler->>User: Response with success or fallback if error
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
onError
callback function can be passed intohandleAuth
to handle errors when handling redirect back to app during auth flow (state check) - app router only.env
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.