Skip to content

Commit

Permalink
Adrienne / Add front channels (#18105)
Browse files Browse the repository at this point in the history
* feat: store redirect metadata for traders hub from os-redirect

* Merge branch 'master' of github.com:deriv-com/deriv-app

* chore: add new route for front channels to be registered in hydra

* chore: remove route for silent callback
  • Loading branch information
adrienne-deriv authored Mar 6, 2025
1 parent aae5e48 commit 9eddb5f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core/build/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ const copyConfig = base => {
to: 'localstorage-sync.html',
toType: 'file',
},
{
from: path.resolve(__dirname, '../src/root_files/front-channel.html'),
to: 'front-channel.html',
toType: 'file',
},
{ from: path.resolve(__dirname, '../src/root_files/robots.txt'), to: 'robots.txt', toType: 'file' },
{ from: path.resolve(__dirname, '../src/root_files/sitemap.xml'), to: 'sitemap.xml', toType: 'file' },
{
Expand Down
26 changes: 26 additions & 0 deletions packages/core/src/root_files/front-channel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<html>
<head>
<title>Deriv</title>
<meta charset="utf-8" />
<script>
try {
// we check if we can access the top.location, if we can't it will throw an error
// and this means this front-channel is not rendered on the same window as the application which is logging out
let isSameOrigin = top.location.hostname === self.location.hostname;
} catch (err) {
localStorage.removeItem('closed_toast_notifications');
localStorage.removeItem('is_wallet_migration_modal_closed');
localStorage.removeItem('active_wallet_loginid');
localStorage.removeItem('config.account1');
localStorage.removeItem('config.tokens');
localStorage.removeItem('client.accounts');
localStorage.removeItem('verification_code.system_email_change');
localStorage.removeItem('verification_code.request_email');
localStorage.removeItem('new_email.system_email_change');
}
</script>
</head>

<body></body>
</html>

0 comments on commit 9eddb5f

Please sign in to comment.