@@ -845,6 +845,7 @@ export class OAuthService extends AuthConfig {
845845 const redirectUri = this . silentRefreshRedirectUri || this . redirectUri ;
846846 this . createLoginUrl ( null , null , redirectUri , noPrompt , params ) . then ( url => {
847847 iframe . setAttribute ( 'src' , url ) ;
848+
848849 if ( ! this . silentRefreshShowIFrame ) {
849850 iframe . style [ 'display' ] = 'none' ;
850851 }
@@ -1703,7 +1704,8 @@ export class OAuthService extends AuthConfig {
17031704 if ( noRedirectToLogoutUrl ) {
17041705 return ;
17051706 }
1706- if ( ! id_token ) {
1707+
1708+ if ( ! id_token && ! this . postLogoutRedirectUri ) {
17071709 return ;
17081710 }
17091711
@@ -1721,13 +1723,22 @@ export class OAuthService extends AuthConfig {
17211723 . replace ( / \{ \{ i d _ t o k e n \} \} / , id_token )
17221724 . replace ( / \{ \{ c l i e n t _ i d \} \} / , this . clientId ) ;
17231725 } 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+
17241738 logoutUrl =
17251739 this . logoutUrl +
17261740 ( 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 ( )
17311742 }
17321743 location . href = logoutUrl ;
17331744 }
0 commit comments