Skip to content

Commit

Permalink
Bypass refreshToken() when authentication is not enabled.
Browse files Browse the repository at this point in the history
Fixes #2899
  • Loading branch information
chrisknoll committed Dec 14, 2023
1 parent 61480af commit 97871b9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/services/AuthAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ define(function(require, exports) {
}
var refreshToken = function() {

if (!config.userAuthenticationEnabled) {
return Promise.resolve(true); // no-op if userAuthenticationEnabled == false
}

if (!isPromisePending(refreshTokenPromise)) {
refreshTokenPromise = httpService.doGet(getServiceUrl() + "user/refresh");
refreshTokenPromise.then(({ data, headers }) => {
Expand Down Expand Up @@ -517,9 +521,7 @@ define(function(require, exports) {

const executeWithRefresh = async function(httpPromise) {
const result = await httpPromise;
if (config.userAuthenticationEnabled) {
await refreshToken();
}
await refreshToken();
return result;
}

Expand Down

0 comments on commit 97871b9

Please sign in to comment.