File tree Expand file tree Collapse file tree
packages/oidc-client/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,16 +289,18 @@ export async function oidc<ActionType extends ActionTypes = ActionTypes>({
289289 options : storageOptions ,
290290 } ) ;
291291 } ) ,
292- Micro . tap ( async ( tokens ) => {
293- await store . dispatch (
294- oidcApi . endpoints . revoke . initiate ( {
295- accessToken : tokens . accessToken ,
296- clientId : config . clientId ,
297- endpoint : wellknown . revocation_endpoint ,
298- } ) ,
299- ) ;
300- await storageClient . remove ( ) ;
301- await storageClient . set ( tokens ) ;
292+ Micro . tap ( async ( newTokens ) => {
293+ if ( tokens && 'accessToken' in tokens ) {
294+ await store . dispatch (
295+ oidcApi . endpoints . revoke . initiate ( {
296+ accessToken : tokens . accessToken ,
297+ clientId : config . clientId ,
298+ endpoint : wellknown . revocation_endpoint ,
299+ } ) ,
300+ ) ;
301+ await storageClient . remove ( ) ;
302+ }
303+ await storageClient . set ( newTokens ) ;
302304 } ) ,
303305 ) ;
304306
You can’t perform that action at this time.
0 commit comments