Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix token-request in retry strategy. #685

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lib/services/sf.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,11 +1478,14 @@ StateRenewing.prototype.enter = function (context)
{
method: 'POST',
url: '/session/token-request',
json:
{
'REQUEST_TYPE': 'RENEW',
'oldSessionToken': this.tokenInfo.getSessionToken()
},
headers: {
CLIENT_APP_ID: this.connectionConfig.getClientType(),
CLIENT_APP_VERSION: this.connectionConfig.getClientVersion(),
},
json: {
'REQUEST_TYPE': 'RENEW',
'oldSessionToken': this.tokenInfo.getSessionToken(),
},
scope: this,
callback: function (err, body)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ exports.getNextSleepTime = getNextSleepTime;
* @returns {Boolean} true if it is loginRequest, otherwise false.
*/
exports.isLoginRequest = function (loginUrl) {
const endPoints = ['/v1/login-request', '/authenticator-request', '/token-request',];
const endPoints = ['/v1/login-request', '/authenticator-request'];
return endPoints.some((endPoint) => loginUrl.includes(endPoint));
}

Expand Down
12 changes: 1 addition & 11 deletions test/unit/util_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,17 +545,7 @@ describe('Util', function ()
testName: 'test URL with a wrong authenticator-request point',
endPoint: '/authenticator-requ',
result:false,
},
{
testName: 'test URL with a right token point',
endPoint: '/token-request',
result:true,
},
{
testName: 'test URL with a wrong token point',
endPoint: '/tokenRequest',
result:false,
},
}
];

for (const {testName, endPoint,result} of testCases)
Expand Down
Loading