Skip to content

Commit 6b1dff6

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(monday): forward users through app installation
1 parent 44d5fec commit 6b1dff6

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎apps/sim/lib/auth/connectors/providers.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,6 +1754,7 @@ export function buildConnectorProviders(): GenericOAuthConfig[] {
17541754
pkce: true,
17551755
authentication: 'post',
17561756
redirectURI: `${getBaseUrl()}/api/auth/oauth2/callback/monday`,
1757+
authorizationUrlParams: { force_install_if_needed: 'true' },
17571758
getToken: async ({ code, codeVerifier, redirectURI }) => {
17581759
if (!codeVerifier) {
17591760
throw new Error('Monday OAuth token exchange requires a PKCE verifier')

‎apps/sim/lib/oauth/oauth.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ describe('Monday OAuth connector', () => {
178178
pkce: true,
179179
authentication: 'post',
180180
redirectURI: 'http://localhost:3000/api/auth/oauth2/callback/monday',
181+
authorizationUrlParams: { force_install_if_needed: 'true' },
181182
})
182183
const authorizationUrl = await createAuthorizationURL({
183184
id: connector.providerId,
@@ -192,12 +193,14 @@ describe('Monday OAuth connector', () => {
192193
scopes: connector.scopes,
193194
redirectURI: connector.redirectURI!,
194195
responseType: connector.responseType,
196+
additionalParams: connector.authorizationUrlParams,
195197
})
196198

197199
expect(authorizationUrl.searchParams.get('redirect_uri')).toBe(
198200
'http://localhost:3000/api/auth/oauth2/callback/monday'
199201
)
200202
expect(authorizationUrl.searchParams.get('scope')).toBe(connector.scopes?.join(' '))
203+
expect(authorizationUrl.searchParams.get('force_install_if_needed')).toBe('true')
201204
expect(authorizationUrl.searchParams.get('code_challenge_method')).toBe('S256')
202205
expect(authorizationUrl.searchParams.get('code_challenge')).toBeTruthy()
203206
})

0 commit comments

Comments
 (0)