Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Klp-login-widget generate wrong link for the selfadmin when the logoutUrl is not the same domain as the user profile #3078

Open
syjer opened this issue May 12, 2024 · 0 comments
Assignees
Labels
🐞 bug Something isn't working request

Comments

@syjer
Copy link

syjer commented May 12, 2024

Hi,

This is something we noticed in the MYSB project using version 6 of the design-system:

The kpl-login-widget use the logoutUrl as a base url for building the profile url: https://github.com/swisspost/design-system/blob/main/packages/internet-header/src/assets/js/klp-login-widget.js#L408 :

   const url = getLocation(logoutURL());
   originUrl = url.origin;
   const menuLinks = [
     {
       description: texts[currentLang].userProfile,
       url: originUrl + '/selfadmin/?lang=' + currentLang,
       iconclass: 'widget_icon_profile',
     },
   ];
function logoutURL() {
      const serviceForLogout = 'klp';
      const inIframe = false;
      return join(
        platform.logoutURL,

As you may notice, the generated selfadmin url this will not work if we have a logoutUrl with a domain : "mysb-int.post.ch" .

As a workaround we do an internal redirect but the better solution would be:

  1. allow to override the base url for the selfadmin application (used for 2 links in the menu)
  2. OR hardcode in the klp-login-widget the various platform->url mapping.
@oliverschuerch oliverschuerch added 🐞 bug Something isn't working request labels May 15, 2024
@gfellerph gfellerph added on hold Wait for something to be done, before continue working on this Issue and removed on hold Wait for something to be done, before continue working on this Issue labels May 29, 2024
@github-actions github-actions bot added the stale label Aug 27, 2024
@gfellerph gfellerph removed the stale label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working request
Projects
Status: 💻 Ready for development
Development

No branches or pull requests

3 participants