Skip to content

Commit

Permalink
Merge pull request #1825 from andsouto/logoff-url-handler-problem
Browse files Browse the repository at this point in the history
fix problem in logoff when urlHandler option is present
  • Loading branch information
FabianGosebrink authored Aug 22, 2023
2 parents da67bb5 + 54d893a commit bd73ff2
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 bd73ff2

Please sign in to comment.