react-intercom icon indicating copy to clipboard operation
react-intercom copied to clipboard

user signout on unmount

Open clairefro opened this issue 4 years ago • 5 comments

[Question] I see in the code that window.Intercom('shutdown') is called in componentWillReceiveProps() and componentWillUnmount(), however the session seems to persist when leaving the website and coming back. I also tried deleting cookies.

How can we ensure a session gets closed when user leaves the webpage?

(thanks for this package by the way, it's awesome!)

clairefro avatar Mar 16 '20 16:03 clairefro

any updates on this issue?

wasims1 avatar Apr 17 '20 09:04 wasims1

I second this, how can we do a complete shutdown. Its not currently doing it on log out.

hatched-esther avatar May 06 '20 03:05 hatched-esther

Bump - Dealing with this issue as well.

timrodz avatar Jul 27 '20 02:07 timrodz

@hatched-esther The shutdown is nothing more than removing the window.Intercom and window.intercomSettings object. Also make sure your Intercom related cookies are removed (this should have happened automatically when calling IntercomAPI('shutdown').

In case you're interested I've made an abstraction to make this more dev-friendly in React: https://github.com/devrnt/react-use-intercom

devrnt avatar Jul 27 '20 16:07 devrnt

Thanks @devrnt - Trying it out now :)

timrodz avatar Jul 29 '20 22:07 timrodz