Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maryia/BOT-2661/[App Separation] - Integrate query param logic to maintain auth context propagation #230

Merged
merged 12 commits into from
Jan 20, 2025

Conversation

maryia-matskevich-deriv
Copy link
Contributor

@maryia-matskevich-deriv maryia-matskevich-deriv commented Jan 3, 2025

[App Separation] - Integrate query param logic to maintain auth context propagation

Description: As a developer I want to implement a seamless auth flow. Meaning if the user clicks on DBot from app.deriv.com (Traders Hub/Dtrader) or any other app. It should propagate the selected account in the source tab to the newly opened tab.

Slack Conversation: https://deriv-group.slack.com/archives/C0871BRSJN4/p1735032395607869

Scenarios Document: https://docs.google.com/document/d/1Taq5ypnVG8KDVWTx5IdPJyWRaB3PCaNXa2yEVOMddNA/edit?usp=sharing

Screenshot 2025-01-03 at 17 16 44

[DBOT] Account Switching Across Tabs

We need to standardise the behaviour of the platforms/tabs being opened from the TH and vice versa. Due to different standalone applications - Bots, P2P, Dtrader and TH the behaviour varies across different apps and clicks.
There are 3 ground rules to be taken care of :
No Back-syncing
Example : If an app, say DTrader, is opened with Demo account selected and user clicks on TH in a new tab and switches it to Real USD , then the previously opened DTrader will NOT be updated to Real USD.
2. Use the Source currency
Example : User is working on DTrader in demo account and then opens TH in new tab and switches it to Real USD. After this he opens Bots. Bots account should then be opened for Real USD.
3. Start a new tab/browser
 If a user opens a new tab/browser and types in the URL (rather than opening it from the previously opened tab), then it should check the last opened state of the platform in the browser.  If no previous state is found, it should be defaulted to Real FIAT account or Demo (if real is not created).
Example : If an app, say DTrader, is opened with Demo account selected and user clicks on TH in a new tab and switches it to Real USD. Then he opens a new tab and types in Bots URL. If he had previously accessed Bots with ETH currency, then the same should be opened now too.

src/app/App.tsx Outdated Show resolved Hide resolved
src/app/App.tsx Outdated Show resolved Hide resolved
src/app/App.tsx Outdated Show resolved Hide resolved
src/app/App.tsx Outdated Show resolved Hide resolved
…e it when user switches acc"

This reverts commit 717ed1b.
Copy link

Preview Link: https://maryia-BOT-2661.bot-65f.pages.dev

Name Result
Build status Completed ✅
Preview URL Visit Preview
Action URL Visit Action

@farabi-deriv farabi-deriv merged commit b0d7b3b into deriv-com:master Jan 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants