laurent22/joplin · error · Error

User is not authenticated

Error message

User is not authenticated

What it means

Thrown by SyncTargetDropbox.initSynchronizer() when isAuthenticated() returns false. The Dropbox sync target needs a valid OAuth token stored under Setting `sync.<id>.auth`; without it the Synchronizer cannot be constructed and Dropbox sync cannot start.

Source

Thrown at packages/lib/SyncTargetDropbox.ts:73

		});

		api.on('authRefreshed', (auth: string|null) => {
			this.logger().info('Saving updated Dropbox auth.');
			Setting.setValue(`sync.${SyncTargetDropbox.id()}.auth`, auth ? auth : null);
		});

		const authToken = Setting.value(`sync.${SyncTargetDropbox.id()}.auth`);
		api.setAuthToken(authToken);

		const appDir = '';
		const fileApi = new FileApi(appDir, new FileApiDriverDropbox(api));
		fileApi.setSyncTargetId(SyncTargetDropbox.id());
		fileApi.setLogger(this.logger());
		return fileApi;
	}

	public async initSynchronizer() {
		if (!(await this.isAuthenticated())) throw new Error('User is not authenticated');
		return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
	}
}

View on GitHub (pinned to 2654b33620)

Solutions

  1. Open Joplin sync settings, pick Dropbox, and complete the OAuth authorisation flow again.
  2. If auth keeps failing, revoke the app from Dropbox's Connected Apps page, then re-authorise in Joplin.
  3. Confirm system clock is correct — large skew can invalidate OAuth responses.
  4. After successful auth, retry the sync.

Example fix

// before: initSynchronizer() throws 'User is not authenticated'
// after: in Joplin UI
// Tools -> Synchronisation -> Synchronisation target: Dropbox
// Follow the OAuth link, grant access, then click 'Synchronise'.
Defensive patterns

Strategy: validation

Validate before calling

// Check the stored Dropbox auth token exists and is non-empty before initSynchronizer.
const token = Setting.value(`sync.${SyncTargetDropbox.id()}.auth`);
if (!token) throw new Error('Dropbox not authenticated — run the OAuth flow first');

Type guard

const hasAuthToken = () => !!Setting.value(`sync.${SyncTargetDropbox.id()}.auth`);

Try / catch

try { await syncTarget.initSynchronizer(); }
catch (e) { if (/User is not authenticated/.test(e.message)) { /* trigger OAuth re-flow */ } else throw e; }

Prevention

When it happens

Trigger: User enables Dropbox sync but has not completed the OAuth flow, or the stored token was revoked/expired. initSynchronizer() calls isAuthenticated() which returns false.

Common situations: First-time setup where the user skipped the auth wizard; token revoked via Dropbox app settings; long- unused install whose token expired; clock skew invalidating token checks.

Understand the failure class

Related errors


AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12). Data as JSON: /api/errors/5546bbf75faf1a28. Report an issue: GitHub.