feat(auth): pass callback url through login#96
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional callbackUrl to the auth.login API surface and forwards it to the credentials login endpoint as the callback_url query parameter, while reducing duplicated inline typing by introducing a shared public input type.
Changes:
- Introduces
LoginInputas a public type forauth.login. - Updates
auth.loginto serializecallbackUrlascallback_urlin the request query. - Reuses
LoginInputin the Promise client and updates request-shape test + README usage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/domains/auth.ts | Adds LoginInput and forwards callbackUrl as callback_url in login query params. |
| src/domains/auth.spec.ts | Updates auth flow coverage to assert callback_url is included/encoded in the login request URL. |
| src/core/client.ts | Reuses the shared LoginInput type for the Promise client auth.login signature. |
| README.md | Updates login usage example to include the optional callbackUrl field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
🎉 This PR is included in version 9.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Adds a
callbackUrloption toauth.loginand serializes it ascallback_urlfor the credential login endpoint.Changed
LoginInputtype for the auth login surfacecallback_urlthrough the existing query builderRisks
Low. Existing login calls keep the same required fields and the new field is optional. Current backend behavior accepts the query parameter but does not enforce callback behavior yet, so server-side callback validation remains a backend follow-up.
Verification
vp run verifygit diff --checkcallback_urlare accepted and resulting tokens validateautoreview --mode branch --base origin/maincleanComplexity
Neutral. This narrows duplicate inline typing by sharing the public login input type.
Summary by cubic
Add optional
callbackUrltoauth.login, sent ascallback_urlin the login request. Introduces a publicLoginInputtype used by the Promise client, with tests and README updated.Written for commit e33b8c3. Summary will update on new commits.