#7296·nango

fix(self-hosted): profile update returns 500 with dashboard Basic auth

Author: LevSky22Created Aug 29, 2026Updated Sep 28, 2026
LabelsStale

Summary

On self-hosted Nango deployments using dashboard HTTP Basic auth, updating the Profile Settings display name persists the database change but returns 500. The dashboard consequently shows a failure toast even though the name changed.

Environment

  • Self-hosted Nango 0.71.4
  • FLAG_AUTH_ENABLED=false
  • NANGO_DASHBOARD_USERNAME and NANGO_DASHBOARD_PASSWORD configured

In this configuration, routes.private.ts authenticates dashboard requests with Passport Basic auth using { session: false }.

Steps to reproduce

  1. Start a self-hosted deployment with the Basic-auth configuration above.
  2. Sign in to the dashboard and open Profile settings.
  3. Edit and save the display name.
  4. Observe a generic server-error toast.
  5. Reload the page or inspect _nango_users; the new name was persisted.

Expected behavior

PATCH /api/v1/user returns 200 with the updated user, and the dashboard shows success.

Actual behavior

userService.update commits successfully, then the controller throws while evaluating:

typescript
req.session.passport.user = updated;

Basic authentication deliberately has no persistent Passport session, so req.session.passport is undefined. The resulting synchronous error is wrapped as a generic 500 after the durable update has already happened.

Root cause and proposed fix

The session rewrite is obsolete for both authentication modes:

  • Basic auth resolves the user from PostgreSQL on every request.
  • Session auth serializes the user ID, and fillLocalsFromSession reloads the current database user with userService.getUserById(req.user.id) on every request.

The minimal fix is to remove the direct Passport-session mutation and return userToAPI(updated) after the database update.

Tested patch: https://github.com/LevSky22/nango/commit/4cdb0afb4348780d5970d9748fac1f3c87f40740

The patch adds:

  • A unit regression test proving profile updates succeed without session.passport.
  • An integration test proving a real session stays authenticated and observes the updated name on a subsequent GET.

Validation completed:

  • Focused unit test
  • Focused integration test with Testcontainers
  • npm run ts-build
  • Prettier and type-aware oxlint on the changed files

Following the repository contribution policy, I have not opened a pull request. I am happy to open one if maintainers would like this patch submitted directly.