Skip to content

Commit 7157194

Browse files
glo80771glo42707glo82145
authored
PWA-3134::The signout event is not captured (#4121)
* PWA-3134::The signout event is not captured * PWA-3134::Resolved lint issues * PWA-3134::Formatted the code * PWA-3134::The signout event is not captured --------- Co-authored-by: arpit khare <[email protected]> Co-authored-by: Aanchal Pawar <[email protected]> Co-authored-by: glo82145 <[email protected]>
1 parent 13d295a commit 7157194

File tree

1 file changed

+32
-0
lines changed
  • packages/extensions/experience-platform-connector/src/handlers

1 file changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const canHandle = event => event.type === 'USER_SIGN_OUT';
2+
3+
const handle = sdk => {
4+
sdk.context.setShopper({
5+
shopperId: 'guest'
6+
});
7+
8+
const accountContext = {
9+
firstName: '',
10+
lastName: '',
11+
emailAddress: ''
12+
};
13+
14+
const cartContext = {
15+
id,
16+
prices: {},
17+
items: {},
18+
possibleOnepageCheckout: false,
19+
giftMessageSelected: false,
20+
giftWrappingSelected: false
21+
};
22+
23+
sdk.context.setShoppingCart(cartContext);
24+
sdk.context.setAccount(accountContext);
25+
26+
sdk.publish.signOut();
27+
};
28+
29+
export default {
30+
canHandle,
31+
handle
32+
};

0 commit comments

Comments
 (0)