Skip to content

Commit f72462c

Browse files
Jonathan Yeemanfredsteyer
Jonathan Yee
authored andcommitted
feature: add new event for oidc session unchanged
1 parent 9e2dc91 commit f72462c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

projects/lib/src/events.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export type EventType =
1919
| 'session_changed'
2020
| 'session_error'
2121
| 'session_terminated'
22+
| 'session_unchanged'
2223
| 'logout'
2324
| 'popup_closed'
2425
| 'popup_blocked'

projects/lib/src/oauth-service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,9 @@ export class OAuthService extends AuthConfig implements OnDestroy {
12521252
// only run in Angular zone if it is 'changed' or 'error'
12531253
switch (e.data) {
12541254
case 'unchanged':
1255-
this.handleSessionUnchanged();
1255+
this.ngZone.run(() => {
1256+
this.handleSessionUnchanged();
1257+
});
12561258
break;
12571259
case 'changed':
12581260
this.ngZone.run(() => {
@@ -1277,6 +1279,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
12771279

12781280
protected handleSessionUnchanged(): void {
12791281
this.debug('session check', 'session unchanged');
1282+
this.eventsSubject.next(new OAuthInfoEvent('session_unchanged'));
12801283
}
12811284

12821285
protected handleSessionChange(): void {

0 commit comments

Comments
 (0)