manfredsteyer / angular-oauth2-oidc

Support for OAuth 2 and OpenId Connect (OIDC) in Angular.
MIT License
1.86k stars 681 forks source link

`noRedirectToLogoutUrl` parameter is not checked in `logOut` method #1410

Closed Sinan997 closed 1 month ago

Sinan997 commented 2 months ago

Describe the bug I am using revokeTokenAndLogout method of OAuthService. I am passing an object to this method.

const myObj = {
  ...,
  noRedirectToLogoutUrl: true
}

revokeTokenAndLogout(myObj)

If i use it as above, it calls logout method with the provided object.

Everything is fine so far, but in this logout method it doesn't check the noRedirectToLogoutUrl if it is provided in object.

It only checks if the parameter type is boolean, otherwise it wont https://github.com/manfredsteyer/angular-oauth2-oidc/blob/03357909ed3013623a1a69f9599f015d46aa4906/projects/lib/src/oauth-service.ts#L2490-L2495 https://github.com/manfredsteyer/angular-oauth2-oidc/blob/03357909ed3013623a1a69f9599f015d46aa4906/projects/lib/src/oauth-service.ts#L2529-L2531

To Reproduce Use the logout method as below; and check is it returns at this line

const myObj = {
  ...,
  noRedirectToLogoutUrl: true
}

revokeTokenAndLogout(myObj)

Expected behavior noRedirectToLogoutUrl parameter might be provided in object, it should also search in object.

Desktop (please complete the following information):

Additional context If you think this is a problem to be solved, i will be happy to open a pull request.