@@ -845,6 +845,7 @@ export class OAuthService extends AuthConfig {
845
845
const redirectUri = this . silentRefreshRedirectUri || this . redirectUri ;
846
846
this . createLoginUrl ( null , null , redirectUri , noPrompt , params ) . then ( url => {
847
847
iframe . setAttribute ( 'src' , url ) ;
848
+
848
849
if ( ! this . silentRefreshShowIFrame ) {
849
850
iframe . style [ 'display' ] = 'none' ;
850
851
}
@@ -1703,7 +1704,8 @@ export class OAuthService extends AuthConfig {
1703
1704
if ( noRedirectToLogoutUrl ) {
1704
1705
return ;
1705
1706
}
1706
- if ( ! id_token ) {
1707
+
1708
+ if ( ! id_token && ! this . postLogoutRedirectUri ) {
1707
1709
return ;
1708
1710
}
1709
1711
@@ -1721,13 +1723,22 @@ export class OAuthService extends AuthConfig {
1721
1723
. replace ( / \{ \{ i d _ t o k e n \} \} / , id_token )
1722
1724
. replace ( / \{ \{ c l i e n t _ i d \} \} / , this . clientId ) ;
1723
1725
} else {
1726
+
1727
+ let params = new HttpParams ( ) ;
1728
+
1729
+ if ( id_token ) {
1730
+ params = params . set ( 'id_token_hint' , id_token ) ;
1731
+ }
1732
+
1733
+ const postLogoutUrl = this . postLogoutRedirectUri || this . redirectUri ;
1734
+ if ( postLogoutUrl ) {
1735
+ params = params . set ( 'post_logout_redirect_uri' , postLogoutUrl ) ;
1736
+ }
1737
+
1724
1738
logoutUrl =
1725
1739
this . logoutUrl +
1726
1740
( this . logoutUrl . indexOf ( '?' ) > - 1 ? '&' : '?' ) +
1727
- 'id_token_hint=' +
1728
- encodeURIComponent ( id_token ) +
1729
- '&post_logout_redirect_uri=' +
1730
- encodeURIComponent ( this . postLogoutRedirectUri || this . redirectUri ) ;
1741
+ params . toString ( )
1731
1742
}
1732
1743
location . href = logoutUrl ;
1733
1744
}
0 commit comments