From c33fdf96f581d74d1ec7a6f065ef21d1c60b5804 Mon Sep 17 00:00:00 2001 From: Sidati Messaiti Date: Tue, 1 Nov 2022 18:59:33 +0000 Subject: [PATCH] fix: cutom headers overwrite the auth header --- src/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user.js b/src/user.js index 1e0d03e3..f8efe472 100644 --- a/src/user.js +++ b/src/user.js @@ -113,10 +113,10 @@ export default class User { try { const token = await this.jwt(); return await this.api.request(path, { + ...options, headers: Object.assign(options.headers, { Authorization: `Bearer ${token}`, }), - ...options, }); } catch (error) { if (error instanceof JSONHTTPError && error.json) {