fix(factory): add clearPendingVerifierByName to createAuthService proxy#45
Open
nicknisi wants to merge 2 commits into
Open
fix(factory): add clearPendingVerifierByName to createAuthService proxy#45nicknisi wants to merge 2 commits into
nicknisi wants to merge 2 commits into
Conversation
The proxy object returned by createAuthService() was missing the clearPendingVerifierByName method, causing it to be undefined at runtime despite TypeScript reporting it as available. This prevented adapters from safely clearing stale PKCE verifier cookies by name. Closes #44
Greptile Summary
Confidence Score: 5/5The change is a narrow factory proxy delegation fix with direct test coverage. The modified code follows the existing delegation pattern and the added test checks that the proxy exposes the expected method.
What T-Rex did
Reviews (2): Last reviewed commit: "Update src/service/factory.spec.ts" | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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
The proxy object returned by
createAuthService()insrc/service/factory.tswas missing theclearPendingVerifierByNamedelegation, causing the method to beundefinedat runtime despite TypeScript's type assertion saying it exists. This adds the missing delegation entry so adapters can safely callclearPendingVerifierByName()as documented.What was tested
Automated
factory.spec.tsconfirmingtypeof service.clearPendingVerifierByNameis'function'Manual
clearPendingVerifierByName#44:typeof service.clearPendingVerifierByName→'function'(PASS with fix)factory.tstomain→typeof service.clearPendingVerifierByName→'undefined'(FAIL confirms the bug)Manual reproduction steps
On
main, create a script that importscreateAuthServiceand checkstypeof service.clearPendingVerifierByName:Run
pnpm build && node script.mjs(ortsx script.ts)On
main: observeundefined— the method is missing from the proxyOn
fix/issue-44: observe'function'— the delegation is presentVerification
This is a library fix (no UI). Verification was performed via automated tests and a scenario script that reproduces the exact runtime check from issue #44. The revert test confirms the bug exists on
mainand is resolved on this branch.Issue
Closes #44
Follow-ups
None — the fix is a minimal 3-line addition following the identical delegation pattern used by all other methods in the proxy.