Repository navigation
fix: restore verified SDK call shapes in backend references - #56
Merged
Merged
Conversation
The installer pastes these references into the agent prompt. After the
trim they only said "follow the README", and the SDK READMEs are thin,
so agents read SDK source to find method names. Each reference now has a
compact call-shape block checked against the latest published SDK:
client setup, AuthKit authorization URL, code exchange, session handling,
and logout.
Logout now ends the AuthKit session via the SDK's logout URL instead of
only clearing the local session. Node: sealSession goes inside
session: { sealSession, cookiePassword }; a top-level sealSession is
ignored.
[Medium impact] The PR appears safe to merge; both previous findings are addressed. SummaryThe PR restores SDK call examples across nine backend references. The latest changes address both previous findings:
No new actionable issues were found in the changes since the previous review. Reviews (2) · Last reviewed commit: "fix: Laravel logout survives expired tok..." · Reviewed by Greptile |
…rule - Laravel: store the session ID at callback and log out with userManagement()->getLogoutUrl(sessionId:). sessionManager()->getLogoutUrl() throws once the access token expires, which skipped the local cleanup. - Elixir: only API calls take WorkOS.Client first; the local session helpers don't.
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.
Why
The CLI installer pastes these references into its agent's prompt. When I trimmed them in #53, the backend references were reduced to "follow the README". The SDK READMEs are thin (the Go README has no usage examples at all), so agents spent several calls per install reading SDK source to find method names and signatures.
What
Each backend reference (Node, Python, Ruby, Go, PHP, Laravel, Kotlin, Elixir, .NET) now has a compact Call shapes block, checked against the latest published SDK. Each file states the version it was checked against. The block covers:
Corrections that came out of checking:
sealSessiongoes insidesession: { sealSession, cookiePassword }. The old top-level placement is silently ignored (factory-*.mjscheckssession?.sealSession).Provider: "authkit"is required. The SDK errors ifProvider,ConnectionID, andOrganizationIDare all empty. Logout needs thesidclaim from the access token, and the SDK has no JWT decoder.providertakes the enum value. The cookie password must be base64 that decodes to exactly 32 bytes (sodium secretbox).authenticate_with_codehas noseal_sessionoption; useseal_session_from_auth_response.WORKOS_COOKIE_PASSWORDandWORKOS_REDIRECT_URIare added where the gotchas referred to them but.envdidn't list them.Verification
pnpm test: 574 passed. Format is clean.