Skip to content

Commit

Permalink
fix problem in logoff when urlHandler option is present
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrés Souto committed Aug 22, 2023
1 parent da67bb5 commit 54d893a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { ResetAuthDataService } from '../flows/reset-auth-data.service';
import { CheckSessionService } from '../iframe/check-session.service';
import { LoggerService } from '../logging/logger.service';
import { StoragePersistenceService } from '../storage/storage-persistence.service';
import { UrlService } from '../utils/url/url.service';
import { RedirectService } from '../utils/redirect/redirect.service';
import { UrlService } from '../utils/url/url.service';
import { LogoffRevocationService } from './logoff-revocation.service';

describe('Logout and Revoke Service', () => {
Expand Down Expand Up @@ -481,6 +481,10 @@ describe('Logout and Revoke Service', () => {
spy(url);
};
const redirectSpy = spyOn(redirectService, 'redirectTo');
const resetAuthorizationDataSpy = spyOn(
resetAuthDataService,
'resetAuthorizationData'
);

spyOn(checkSessionService, 'serverStateChanged').and.returnValue(false);
const config = { configId: 'configId1' };
Expand All @@ -492,6 +496,7 @@ describe('Logout and Revoke Service', () => {
result$.subscribe(() => {
expect(redirectSpy).not.toHaveBeenCalled();
expect(spy).toHaveBeenCalledOnceWith('someValue');
expect(resetAuthorizationDataSpy).toHaveBeenCalled();
});
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class LogoffRevocationService {
`Custom UrlHandler found. Using this to handle logoff with url '${endSessionUrl}'`
);
urlHandler(endSessionUrl);
this.resetAuthDataService.resetAuthorizationData(config, allConfigs);

return of(null);
}
Expand Down

0 comments on commit 54d893a

Please sign in to comment.