File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2095,10 +2095,11 @@ export class OAuthService extends AuthConfig implements OnDestroy {
2095
2095
/**
2096
2096
* Removes all tokens and logs the user out.
2097
2097
* If a logout url is configured, the user is
2098
- * redirected to it.
2098
+ * redirected to it with optional state parameter .
2099
2099
* @param noRedirectToLogoutUrl
2100
+ * @param state
2100
2101
*/
2101
- public logOut ( noRedirectToLogoutUrl = false ) : void {
2102
+ public logOut ( noRedirectToLogoutUrl = false , state = '' ) : void {
2102
2103
const id_token = this . getIdToken ( ) ;
2103
2104
this . _storage . removeItem ( 'access_token' ) ;
2104
2105
this . _storage . removeItem ( 'id_token' ) ;
@@ -2151,6 +2152,10 @@ export class OAuthService extends AuthConfig implements OnDestroy {
2151
2152
const postLogoutUrl = this . postLogoutRedirectUri || this . redirectUri ;
2152
2153
if ( postLogoutUrl ) {
2153
2154
params = params . set ( 'post_logout_redirect_uri' , postLogoutUrl ) ;
2155
+
2156
+ if ( state ) {
2157
+ params = params . set ( 'state' , state ) ;
2158
+ }
2154
2159
}
2155
2160
2156
2161
logoutUrl =
You can’t perform that action at this time.
0 commit comments