Skip to content

Commit 0069cd6

Browse files
authored
Merge pull request #69 from Yoshify/fix/refresh-token-shadowing
fix: pull optional parameter up to refreshTokens abstraction
2 parents 01d148b + 20eb0f5 commit 0069cd6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/sdk/clients/server/authorization-code.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,14 @@ const createAuthorizationCodeClient = (
142142
* Method makes user of the `refreshTokens` method of the `AuthCodeAbstract` client
143143
* to use the refresh token to get new tokens
144144
* @param {SessionManager} sessionManager
145+
* @param {boolean} [commitToSession=true] - Optional parameter, determines whether to commit the refreshed tokens to the session. Defaults to true.
145146
* @returns {Promise<OAuth2CodeExchangeResponse>}
146147
*/
147148
const refreshTokens = async (
148-
sessionManager: SessionManager
149+
sessionManager: SessionManager,
150+
commitToSession: boolean = true
149151
): Promise<OAuth2CodeExchangeResponse> => {
150-
return await client.refreshTokens(sessionManager);
152+
return await client.refreshTokens(sessionManager, commitToSession);
151153
};
152154

153155
/**

0 commit comments

Comments
 (0)