From 08489b6d4e419594835315e56f89996100288346 Mon Sep 17 00:00:00 2001 From: pedr Date: Wed, 3 Apr 2024 10:34:42 -0300 Subject: [PATCH] avoid unnecessary req when credentials are empty --- packages/lib/JoplinServerApi.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/lib/JoplinServerApi.ts b/packages/lib/JoplinServerApi.ts index 9f96751426a..6dbb81291a7 100644 --- a/packages/lib/JoplinServerApi.ts +++ b/packages/lib/JoplinServerApi.ts @@ -80,6 +80,10 @@ export default class JoplinServerApi { const clientInfo = await this.getClientInfo(); + if (!this.options_.username() || !this.options_.password()) { + return null; + } + try { this.session_ = await this.exec_('POST', 'api/sessions', null, { email: this.options_.username(),