btp-cloud-platform icon indicating copy to clipboard operation
btp-cloud-platform copied to clipboard

[doc issue] Appending query parameter to the logoutEndpoint

Open nocin opened this issue 9 months ago • 2 comments

Issue description

Hi,

it seems the documentation is not clear enough, or it could also be a bug. The documentation mentions, that you can provide a query parameter to the logout endpoint.

The logoutEndpoint can be called with query parameters. For example: Sample Code

window.location.replace('/my/logout?siteId=3');

Followed by the xs-app.json sample

In the following example, my-static-resources is a folder in the working directory of the application router; the folder contains the file logout-page.html along with other static resources. Sample Code

{ 
  "authenticationMethod": "route", 
  "logout": { 
    "logoutEndpoint": "/my/logout", 
    "logoutPage": "/logout-page.html"
  }, 
  "routes": [ 
    {
      "source": "^/logout-page.html$", 
      "localDir": "my-static-resources", 
      "authenticationType": "none"
    }
  ]
} 

When appending a query parameter, in the URL you see the query parameter got successfully appended /logged-out.html?siteId=3, but the app router will not resolve correctly. It then forces you to login, followed by a:

Cannot GET /logged-out.html

I could resolve the issue by adjusting the source pattern in the xs-app.json.

From

"source": "^/logout-page.html$",

To

"source": "^/logged-out.html(\\?.*)?$",

Tested with approuter version 20.

BR, Nico

Feedback Type (Optional)

None

Page Title on SAP Help Portal (prefilled)

logout

Page URL on SAP Help Portal (prefilled)

https://help.sap.com/docs/btp/sap-business-technology-platform/logout

nocin avatar Apr 29 '25 09:04 nocin

Thank you for your feedback! We’ll look into it and come back to you if we have any questions.

PlamiIG avatar Apr 29 '25 13:04 PlamiIG

Hi @nocin , Thank you for your feedback! We’ll look into it and come back to you if we have any questions. BR, Sarah

SarahErdmann avatar May 02 '25 08:05 SarahErdmann