Skip to content

Commit 4da98b3

Browse files
authored
Merge pull request #208 from adrienne-deriv/add-front-channels
Adrienne / Added front channels and updated auth client
2 parents 7c651c5 + 9485030 commit 4da98b3

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,md,json}' --config ./.prettierrc"
2727
},
2828
"dependencies": {
29-
"@deriv-com/analytics": "^1.22.1",
30-
"@deriv-com/auth-client": "^1.3.10",
29+
"@deriv-com/analytics": "^1.31.0",
30+
"@deriv-com/auth-client": "^1.4.3",
3131
"@deriv-com/quill-ui": "^1.16.21",
3232
"@deriv/deriv-api": "^1.0.11",
3333
"@deriv/ui": "^0.8.0",

static/front-channel.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Deriv</title>
5+
<meta charset="utf-8" />
6+
<script>
7+
try {
8+
// we check if we can access the top.location, if we can't it will throw an error
9+
// and this means this front-channel is not rendered on the same window as the application which is logging out
10+
let isSameOrigin = top.location.hostname === self.location.hostname;
11+
} catch (err) {
12+
sessionStorage.removeItem('login-accounts');
13+
sessionStorage.removeItem('current-login-account');
14+
sessionStorage.removeItem('user-accounts');
15+
sessionStorage.removeItem('user');
16+
}
17+
</script>
18+
</head>
19+
20+
<body></body>
21+
</html>

0 commit comments

Comments
 (0)