Closed DanielRivers closed 1 month ago
The pull request introduces significant changes to enhance the asynchronous handling of session management across multiple files. Key modifications include converting several synchronous function calls to asynchronous ones, particularly in session management functions. This ensures that session-related operations complete before proceeding with subsequent logic, affecting the control flow in various components, including API client creation and router handling.
File | Change Summary |
---|---|
src/api-client.js |
Updated createKindeManagementAPIClient to use await for sessionManager(req, res) . |
src/handlers/auth.js |
Altered appRouterHandler to await params before assigning endpoint and introduced createStore() for router client initialization. |
src/routerClients/AppRouterClient.js |
Added async createStore() method; moved sessionManager initialization to this method. |
src/session/getAccessToken.js |
Changed invocation of sessionManager(req, res) to be awaited before calling getSessionItem . |
src/session/getClaim.js |
Updated to await sessionManager(req, res) before passing to kindeClient.getClaim . |
src/session/getFlag.js |
Changed to await sessionManager(req, res) before calling kindeClient.getFlag . |
src/session/getOrganization.js |
Refactored to store session in a variable after a single call to sessionManager(req, res) . |
src/session/getPermission.js |
Updated to await sessionManager(req, res) before passing to kindeClient.getPermission . |
src/session/getPermissions.js |
Changed to await sessionManager(req, res) before calling kindeClient.getPermissions . |
src/session/getRoles.js |
Updated to await sessionManager(req, res) before passing to kindeClient.getClaimValue . |
src/session/getUser.ts |
Modified to call sessionManager(req, res) once, storing the result for token retrieval. |
src/session/getUserOrganizations.ts |
Updated sessionManager invocation to use await . |
src/session/index.ts |
Changed sessionManager(req, res) to be awaited before calling kindeClient.refreshTokens . |
src/session/sessionManager.js |
Altered sessionManager to return a promise, requiring await for cookie handling. |
src/utils/appRouter/setVerifierCookie.js |
Updated setVerifierCookie to be asynchronous, with an inner async function for setting cookies. |
src/session/getAccessTokenRaw.js |
Modified to await sessionManager(req, res) before calling getSessionItem . |
createKindeManagementAPIClient
function in src/api-client.js
, which is the same function that was altered in the main PR to introduce asynchronous behavior.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
Adds nextjs 15 support, no interface changes
Resolves: https://github.com/kinde-oss/kinde-auth-nextjs/issues/222
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.