Skip to content

Commit

Permalink
feat(logout): postLogoutRedirectUri should not default to redirectUri
Browse files Browse the repository at this point in the history
  • Loading branch information
reda-alaoui committed Nov 16, 2020
1 parent 8d152c2 commit ff7d1d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions projects/lib/src/auth.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export class AuthConfig {
*/
public postLogoutRedirectUri? = '';

/**
* Defines whether to use 'redirectUri' as a replacement
* of 'postLogoutRedirectUri' if the latter is not set.
*/
public redirectUriAsPostLogoutRedirectUriFallback? = true;

/**
* The auth server's endpoint that allows to log
* the user in when using implicit flow.
Expand Down
2 changes: 1 addition & 1 deletion projects/lib/src/oauth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
params = params.set('id_token_hint', id_token);
}

const postLogoutUrl = this.postLogoutRedirectUri || this.redirectUri;
const postLogoutUrl = this.postLogoutRedirectUri || (this.redirectUriAsPostLogoutRedirectUriFallback && this.redirectUri || '');
if (postLogoutUrl) {
params = params.set('post_logout_redirect_uri', postLogoutUrl);

Expand Down

0 comments on commit ff7d1d9

Please sign in to comment.