Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(connect-ui): skip integrations list when only one integration is allowed #2837

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

bodinsamuel
Copy link
Collaborator

@bodinsamuel bodinsamuel commented Oct 12, 2024

Describe your changes

Fixes https://linear.app/nango/issue/NAN-1787/if-only-one-integrations-allowed-skip-the-list
Fixes https://linear.app/nango/issue/NAN-1892/fix-popup-blocker

  • When only integration is allowed skip directly to integration page
  • Add an intermediate screen to trigger oauth popup to not fall into popup blocker
  • Fix name auth_mode

Tests

npm run dw
npm run dwa
npm run connect-ui:dev:watch
  • add this
diff --git a/packages/server/lib/controllers/v1/connect/sessions/postConnectSessions.ts b/packages/server/lib/controllers/v1/connect/sessions/postConnectSessions.ts
index 4c1b2751..a225e855 100644
--- a/packages/server/lib/controllers/v1/connect/sessions/postConnectSessions.ts
+++ b/packages/server/lib/controllers/v1/connect/sessions/postConnectSessions.ts
@@ -21,6 +21,7 @@ export const postInternalConnectSessions = asyncWrapper<PostInternalConnectSessi
     // @ts-expect-error req.body is never but we want to fake it on purpose
     // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
     req.body = {
+        allowed_integrations: ['algolia']
         end_user: { id: `nango_dashboard_${user.id}`, email: user.email, display_name: user.name }
     } satisfies PostConnectSessions['Body'];
  • Open the UI from the dashboard
  • It should directly open the integration screen

@bodinsamuel bodinsamuel self-assigned this Oct 12, 2024
Copy link

linear bot commented Oct 12, 2024

store.set(provider.data, integration);
await navigate({ to: '/go' });
}
if (data.data.length === 1 && store.session?.allowed_integrations?.length === 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we make this condition a const and reuse it below?

@bodinsamuel bodinsamuel merged commit 990bb41 into master Oct 21, 2024
21 checks passed
@bodinsamuel bodinsamuel deleted the sam/fix/connect-ui-auto-trigger branch October 21, 2024 08:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants