Select to view content in your preferred language

Bug? In a deployment experience SessionManager.SignOut always redirects to /app/page/set-portalurl

199
0
04-22-2025 05:31 PM
Labels (1)
RyanTaylor
Occasional Contributor

I have an Experience Builder Dev Edition (1.15) app deployed to my own url https://example.com/app. It is configured for OAuth2 authentication to our portal at https://example.com/portal. While sign in is working for the most part, Sign Out is not.

Here is the SignOut code, initiated when a user clicks on the SignOut button.

export async function signOut() {
  const sm = SessionManager.getInstance();
  sm.signOut();
}

Whenever `signOut` is called my app is redirected to https://example.com/app/page/set-portalurl which does not exist in our app. When running the experience via Experience Builder on localhost this makes sense, but it does not make sense for a deployed application.

I stepped into the signOut code at runtime and discovered the following code. I stopped execution on this.removeAuthInfo().

RyanTaylor_0-1745367368142.png

From what I can tell, at  the end of this method Experience Builder will redirect the application to the portal signout page with a redirectUri that depends on jimuConfig properties

  • If `window.jimuConfig.isDevEdition == true` then redirectUri = currentPath + "page/set-portalUrl".
  • else if `window.jimuConfig.isInPortal == true` then redirectUri = currentHref
  • else the redirectUri = protocol + host + "/page/landing"

When I deploy the experience per esri documentation isDevEdition appears to be perpetually true. I think this is set in the generated index.html.

RyanTaylor_1-1745367952548.png

Even if I were to change this to false, there doesn't seem to be a code path that would redirect to a location of my choosing. I would be redirected to https://example.com/page/landing, outside of my application.

This feels like a bug either in documentation or implementation. It would seem there should be a way to specify the redirectUri one would want on SignOut, or, at least the logic above should consider window.jimuConfig.isOutOfExb and provide an appropriate redirect back the app itself.

What am I doing wrong? Is this a bug?

 

0 Replies