Conversation
…faulting - Add GET /sessions/current and POST /sessions/switch-org to dashboard account client - Add doGet/doGetRaw methods to HTTP client for GET request support - Add GetCurrentSession, SwitchOrg, and SyncSessionOrg to auth service - Call SyncSessionOrg after login/SSO to store the server's actual active org - Add 'nylas dashboard orgs list' command to list all user organizations - Add 'nylas dashboard orgs switch' command to switch the active org - Enhance status command to show org name and total org count - Clear active app on org switch to prevent stale cross-org state - Add domain types for session and switch-org API responses - Add 16 unit tests for new auth service methods
- When called without arguments, fetch apps and show interactive selector - User can still pass app ID directly for non-interactive use - Region is auto-detected from the selected app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After login, the CLI blindly stored the first org from the response list rather than the server's actual active org. Additionally, there was no way to switch between organizations or interactively select apps.
Changes
GET /sessions/currentandPOST /sessions/switch-orgsupport in the dashboard account clientdoGet/doGetRawmethods to the HTTP client for GET request supportGetCurrentSession,SwitchOrg, andSyncSessionOrgto the auth serviceSyncSessionOrgafter login/SSO to store the server's actual active orgnylas dashboard orgs listcommand to list all user organizationsnylas dashboard orgs switchcommand to switch the active organizationnylas dashboard apps useinteractive by default (selector when called without args)nylas dashboard statusto show org name and total org countTesting
GetCurrentSession,SwitchOrg,SyncSessionOrgnylas dashboard login→ verify correct org storednylas dashboard orgs list→ verify org tablenylas dashboard orgs switch→ verify org switchingnylas dashboard apps use→ verify interactive selectornylas dashboard status→ verify org name shownRelated