Select to view content in your preferred language

Is it possible to kill a user session of web application where map is displayed, on click of a custom widget button?

892
3
03-12-2019 03:16 PM
KosmasKaradimitriou
New Contributor

My company has a web application implemented in MERN stack. We are using JWT for session management. What we are trying to do is, when the user logs into the app, they should be able to see a logout button on the map(which we are displaying in an iframe). 

We tried following https://community.esri.com/docs/DOC-8591-url-button-widget-version-23-02142017  by Robert Scheitlin, GISP. However, I'm not sure how we can kill the session from our web application. Clicking on the widget will redirect to another website on a new tab, but the map still remains. Has anyone done this before? Is there any other way to implement what we are trying to do?

Robert Scheitlin, GISP‌, I would very much appreciate your help. I have been following a lot of your answers from here on the community to solve minor problems. 

Any suggestion or idea would help. I am completely new to WAB developer edition so would be grateful for a comprehensive suggestion. Looking forward to hearing from someone soon.

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Kosmas,

   The url button widget is designed to always open the url in a new window/Tab. You can change this behavior in the code.

  window.open(this.config.LinkUrl, "_self");
0 Kudos
KosmasKaradimitriou
New Contributor

Robert,

Thank you for your response. 

I want to add a logout button on the map as a widget, so that on clicking that widget, it should redirect me to my login screen *AND* end the session (using JWT for session management). I was thinking if its possible to end my web app's user session by writing code in the widget's widget.js file? Any ideas or suggestions on how I can do that? Thank you. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Kosmas,

   I have zero experience with JWT Sessions. You can write your code in the Widget,js.

0 Kudos