-
Notifications
You must be signed in to change notification settings - Fork 3
Add switchToOrganization and refreshSession helpers to library #11
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
Add switchToOrganization and refreshSession helpers to library #11
Conversation
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.
Pull Request Overview
This PR adds two helper functions—switchToOrganization and refreshSession—to streamline session management and organization switching within the authentication flow. Key changes include:
- Introducing a new refreshSession function to update session tokens.
- Exporting several session helper functions including encryptSession, authkitLoader, and terminateSession.
- Adding a new switchToOrganization function in the auth module and corresponding tests to handle organization switching.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/session.ts | Added refreshSession helper and updated exports of session functions. |
| src/session.spec.ts | Added tests for refreshSession covering success, redirect, and error. |
| src/index.ts | Updated re-exports to include the new refreshSession and switchToOrganization. |
| src/auth.ts | Added switchToOrganization with error handling for SSO/MFA and session refresh. |
| src/auth.spec.ts | Added tests for switchToOrganization validating various flows. |
losephjambert
left a comment
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.
Thanks for putting this together. No notes from me 🙇
capture_20250403_104933.mp4
Example App account route changes (Example)