File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,12 @@ export class AuthCodeWithPKCE extends AuthCodeAbstract {
6969 * `AuthCodeAbstract` parent class, see corresponding comment in parent class for
7070 * further explanation.
7171 * @param {SessionManager } sessionManager
72+ * @param {boolean } [commitToSession=true] - Optional parameter, determines whether to commit the refresh tokens to the session. Defaults to true.
7273 * @returns {Promise<OAuth2CodeExchangeResponse> }
7374 */
7475 public async refreshTokens (
75- sessionManager : SessionManager
76+ sessionManager : SessionManager ,
77+ commitToSession : boolean = true
7678 ) : Promise < OAuth2CodeExchangeResponse > {
7779 const refreshToken = await utilities . getRefreshToken ( sessionManager ) ;
7880 const body = new URLSearchParams ( {
@@ -82,11 +84,13 @@ export class AuthCodeWithPKCE extends AuthCodeAbstract {
8284 } ) ;
8385
8486 const tokens = await this . fetchTokensFor ( sessionManager , body , true ) ;
85- await utilities . commitTokensToSession (
86- sessionManager ,
87- tokens ,
88- this . tokenValidationDetails
89- ) ;
87+ if ( commitToSession ) {
88+ await utilities . commitTokensToSession (
89+ sessionManager ,
90+ tokens ,
91+ this . tokenValidationDetails
92+ ) ;
93+ }
9094 return tokens ;
9195 }
9296
You can’t perform that action at this time.
0 commit comments