Skip to content

Commit 00d5d7a

Browse files
Merge pull request #136 from Gimly/master
Fixed the issue when logout URL has a parameter
2 parents c6a1995 + 439e521 commit 00d5d7a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

angular-oauth2-oidc/src/oauth-service.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1414,10 +1414,12 @@ export class OAuthService
14141414
logoutUrl = this.logoutUrl.replace(/\{\{id_token\}\}/, id_token);
14151415
}
14161416
else {
1417-
logoutUrl = this.logoutUrl + '?id_token_hint='
1418-
+ encodeURIComponent(id_token)
1419-
+ '&post_logout_redirect_uri='
1420-
+ encodeURIComponent(this.postLogoutRedirectUri || this.redirectUri);
1417+
logoutUrl = this.logoutUrl +
1418+
(this.logoutUrl.indexOf('?') > -1 ? '&' : '?')
1419+
+ 'id_token_hint='
1420+
+ encodeURIComponent(id_token)
1421+
+ '&post_logout_redirect_uri='
1422+
+ encodeURIComponent(this.postLogoutRedirectUri || this.redirectUri);
14211423
}
14221424
location.href = logoutUrl;
14231425
};

0 commit comments

Comments
 (0)