feat: add default session fallback for seamless authentication #42
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
Problem Description
When integrating with MCP clients like n8n, users consistently encountered authentication failures despite completing OAuth successfully. The core issue was:
e73774a1-e2ea-4c2f-8f0f-396ef30dd5ba
)976dd4e9-9003-44c9-83f3-6c7a3a31597f
)This created a poor user experience where OAuth would complete successfully but all subsequent API calls would fail.
Solution Implementation
Added default session storage mechanism that automatically falls back to authenticated sessions:
Core Changes
defaultSessionID
anddefaultSessionMu
to Manager structHandleKiteCallback
to store authenticated session as defaultGetOrCreateSession
to use default session for new/invalid sessionsThread Safety
sync.RWMutex
for concurrent access protectionTest Plan
Benefits
This resolves the persistent authentication issue that affected n8n and potentially other MCP client integrations.