Skip to content

Commit 030c4e2

Browse files
authored
refactor(auth): extract connector definitions out of auth.ts (#6203)
auth.ts had grown to 3,927 lines, of which ~2,340 were the genericOAuth connector list — the OAuth apps a workspace connects tools to, as distinct from the handful of providers used to sign in to Sim. Adding a connector meant editing the same file that configures sessions, database hooks and Stripe. Moves that list to lib/auth/connectors/providers.ts behind buildConnectorProviders(), and relocates getMicrosoftUserInfoFromIdToken to lib/oauth/microsoft.ts alongside the three Microsoft helpers it already depends on. auth.ts drops to 1,489 lines and reads as auth configuration again. Pure move, verified mechanically: the connector array is token-identical after stripping whitespace, and all 179 template literals emit byte-identical strings (the one apparent diff was reindentation inside a ${} expression, not text). Behavior, evaluation order and log scopes are unchanged; the array is still built once, when betterAuth() runs. The explicit GenericOAuthConfig[] return type is required, not cosmetic — inline, the entries were contextually typed by the config property. Without it prompt: 'consent' widens to string and every getUserInfo parameter becomes implicitly any.
1 parent 14d9542 commit 030c4e2

3 files changed

Lines changed: 2476 additions & 2443 deletions

File tree

0 commit comments

Comments
 (0)