Skip to content

Commit ff7d1d9

Browse files
committed
feat(logout): postLogoutRedirectUri should not default to redirectUri
1 parent 8d152c2 commit ff7d1d9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

projects/lib/src/auth.config.ts

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ export class AuthConfig {
1515
*/
1616
public postLogoutRedirectUri? = '';
1717

18+
/**
19+
* Defines whether to use 'redirectUri' as a replacement
20+
* of 'postLogoutRedirectUri' if the latter is not set.
21+
*/
22+
public redirectUriAsPostLogoutRedirectUriFallback? = true;
23+
1824
/**
1925
* The auth server's endpoint that allows to log
2026
* the user in when using implicit flow.

projects/lib/src/oauth-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2380,7 +2380,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
23802380
params = params.set('id_token_hint', id_token);
23812381
}
23822382

2383-
const postLogoutUrl = this.postLogoutRedirectUri || this.redirectUri;
2383+
const postLogoutUrl = this.postLogoutRedirectUri || (this.redirectUriAsPostLogoutRedirectUriFallback && this.redirectUri || '');
23842384
if (postLogoutUrl) {
23852385
params = params.set('post_logout_redirect_uri', postLogoutUrl);
23862386

0 commit comments

Comments
 (0)