fix(connect): complete Standalone Connect logins - #111
Open
gjtorikian wants to merge 1 commit into
Open
Conversation
Standalone login clients could not finish authentication because the completion endpoint was missing, making unsupported routes look like expired sessions. Provide the minimal authorize-to-token loop so tests can exercise successful logins and distinguish expiry from completion replay, while keeping Connect codes out of AuthKit's separate exchange. Fixes #109
|
| scopes: appConfig.scopes ?? [], | ||
| audience: appConfig.audience ?? null, | ||
| redirect_uris: appConfig.redirect_uris ?? [], | ||
| login_url: appConfig.login_url ?? null, |
There was a problem hiding this comment.
Seeded login URLs go unchecked
The new seeded login_url is stored without validation, so malformed values are accepted during startup and fail only when /oauth2/authorize returns 400 invalid_redirect_uri. Validating this field with the other connectApplications settings would report configuration errors when the seed is loaded.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/index.ts
Line: 755
Comment:
**Seeded login URLs go unchecked**
The new seeded `login_url` is stored without validation, so malformed values are accepted during startup and fail only when `/oauth2/authorize` returns `400 invalid_redirect_uri`. Validating this field with the other `connectApplications` settings would report configuration errors when the seed is loaded.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
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
POST /authkit/oauth2/complete, upserting users by external ID and emitting user lifecycle events so Standalone Connect clients can finish login.connectApplications[].login_urlto exercise the whole flow locally.SUPPORTED.md(Applications write coverage: 5/8).Validation
bun test: 1,206 passing tests, zero failures.bun run typecheck,bun run lint,bun run fmt:check, andbun run build: passed.bun run gen:events,bun run gen:shapes, andbun run gen:supported: generated catalogs and support matrix are current.Limitations
No PKCE, refresh/ID tokens, consent UI, or
email_change_not_allowedpolicy.user_consent_optionsand authorize-time scopes are not modeled. Provisioned emails are marked verified, following the emulator's SSO precedent. Follow the returned completion URL rather than assuming the production URL shape.An independent review passed with one non-blocking advisory: malformed YAML
login_urlvalues are not checked by the seed config validator (API creation does validate the field's type).Fixes #109