fix: remove bearer token from refresh token request for gmail

This commit is contained in:
Jakub P.
2025-02-10 14:43:06 +01:00
parent 7044e54ce8
commit 46a47e055a
2 changed files with 10 additions and 2 deletions

View File

@@ -12,7 +12,12 @@ const refreshToken = async ($) => {
const { data } = await $.http.post(
'https://oauth2.googleapis.com/token',
params.toString()
params.toString(),
{
additionalProperties: {
skipAddingAuthHeader: true,
},
}
);
await $.auth.set({

View File

@@ -1,5 +1,8 @@
const addAuthHeader = ($, requestConfig) => {
if ($.auth.data?.accessToken) {
if (
!requestConfig.additionalProperties?.skipAddingAuthHeader &&
$.auth.data?.accessToken
) {
requestConfig.headers.Authorization = `${$.auth.data.tokenType} ${$.auth.data.accessToken}`;
}