Skip to content

Conversation

@gpeal
Copy link
Collaborator

@gpeal gpeal commented Oct 17, 2025

This PR adds support for configs to specify a forced login method (chatgpt or api) as well as a forced chatgpt account id. This lets enterprises uses managed configs to force all employees to use their company's workspace instead of their own or any other.

When a workspace id is set, a query param is sent to the login flow which auto-selects the given workspace or errors if the user isn't a member of it.

This PR is large but a large % of it is tests, wiring, and required formatting changes.

API login with chatgpt forced
CleanShot 2025-10-19 at 22 40 04

ChatGPT login with api forced
CleanShot 2025-10-19 at 22 40 29

Onboarding with api forced
CleanShot 2025-10-19 at 22 41 02

Onboarding with ChatGPT forced
CleanShot 2025-10-19 at 22 41 27

Logging in with the wrong workspace
CleanShot 2025-10-19 at 22 42 31

@gpeal gpeal marked this pull request as ready for review October 17, 2025 23:10
@gpeal gpeal requested a review from fouad-openai October 20, 2025 05:42
"refresh_token": "test-refresh-token"
},
"last_refresh": LAST_REFRESH,
"last_refresh": Utc::now(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity why did this have to change? (It does seem odd it was a const before)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test was hitting the refresh oauth token code path and 401ing. We should probably mock it out but this was a simpler fix.

@gpeal gpeal merged commit d87f87e into main Oct 20, 2025
20 checks passed
@gpeal gpeal deleted the gpeal/force-login-org branch October 20, 2025 15:50
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants