Skip to content

Commit

Permalink
amam/add_authorize_brand (#18033)
Browse files Browse the repository at this point in the history
* chore: update auth client

* fix: logout types
  • Loading branch information
amam-deriv authored Jan 30, 2025
1 parent a199ed2 commit 81516ee
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 67 deletions.
75 changes: 39 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,41 @@ This repository contains the various platforms of the Deriv application.

**In this document**:

- [Other Documents](#other-documents)
- [Pre-installation](#Pre-installation)
- [Quick start](#Quick-start)
- [Packages](#packages)
- [Working With This Repo](#working-with-this-repo)
- [Package names](#package-names)
- [Usage](#usage)
- [Starting a Development Server](#starting-a-dev-server)
- [How to Clean Packages](#how-to-clean-packages)
- [Examples of Script Usage](#examples-of-script-usage)
- [Release](#release)
- [PR Guidelines](#pr-guidelines)
- [FAQ](#faq)
- [Other documents:](#other-documents)
- [Pre-installation](#pre-installation)
- [Quick start](#quick-start)
- [Packages](#packages)
- [Working With This Repo](#working-with-this-repo)
- [Package names](#package-names)
- [Usage](#usage)
- [Starting a Development Server](#starting-a-development-server)
- [How to Clean Packages](#how-to-clean-packages)
- [How to clear cache](#how-to-clear-cache)
- [Servable packages](#servable-packages)
- [Examples of Script Usage](#examples-of-script-usage)
- [Release](#release)
- [PR format recommendations](#pr-format-recommendations)
- [Test link deployment](#test-link-deployment)
- [FAQ](#faq)

## Other documents:

- [General](docs/README.md) - Contains general philosophy and overview of this package
- [Stylesheet guidelines](docs/Stylesheet/README.md) - Contains rules for CSS/SASS code style
- [JavaScript guidelines](docs/JavaScript/README.md) - Contains rules for JS/JSX code style
- [Modules docs](docs/Modules/README.md) - Contains implementation guides (i.e., scaffolding, code usage)
- [e2e and performance testing docs](e2e_tests/README.md) - Contains documents for create and running e2e and performance tests
- [Manage dependencies](docs/Dependencies/README.md)
- [General](docs/README.md) - Contains general philosophy and overview of this package
- [Stylesheet guidelines](docs/Stylesheet/README.md) - Contains rules for CSS/SASS code style
- [JavaScript guidelines](docs/JavaScript/README.md) - Contains rules for JS/JSX code style
- [Modules docs](docs/Modules/README.md) - Contains implementation guides (i.e., scaffolding, code usage)
- [e2e and performance testing docs](e2e_tests/README.md) - Contains documents for create and running e2e and performance tests
- [Manage dependencies](docs/Dependencies/README.md)

[comment]: <> (TODO: Refactor Clean Project to be under usage)

## Pre-installation

Before running or contribute to this project, you need to have the setup of the following package in your environment.

- node >=16.16.0
- npm >=7.21.0
- git (for `contribution`)
- node >=16.16.0
- npm >=7.21.0
- git (for `contribution`)

## Quick start

Expand All @@ -57,8 +60,8 @@ Before running or contribute to this project, you need to have the setup of the

> **Internal**: NX and Lerna integration
>
> - Find and copy nx-cloud accessToken
> - Make a copy of `nx-cloud.env.example` from root directory of the project and name it `nx-cloud.env` and replace the `<token>` with provided token.
> - Find and copy nx-cloud accessToken
> - Make a copy of `nx-cloud.env.example` from root directory of the project and name it `nx-cloud.env` and replace the `<token>` with provided token.

3. **Enter project directory**

Expand Down Expand Up @@ -162,15 +165,15 @@ You can read more on the various lerna commands (and the [`clean` command](https

## Servable packages

- account
- appstore
- bot-web-ui
- cashier
- cfd
- components
- core
- p2p
- trader
- account
- appstore
- bot-web-ui
- cashier
- cfd
- components
- core
- p2p
- trader

<br />

Expand Down Expand Up @@ -238,9 +241,9 @@ Upon creating PR, [Vercel](https://vercel.com/) will auto-generate a test link i

If preferable to use manual deployment, you can use [gh-pages](https://pages.github.com/) functionality to create a test link. here are ways to do it:

- You can simply deploy to root of the `gh-pages` branch with: `npm run deploy`.
- You can clean (remove `br_` folders and clear root\) your `gh-pages` branch and deploy to root in a single command with `npm run deploy:clean`
- You can deploy to a folder in your `gh-pages` branch in order to separate from root app deployment and other folder deployments with: `npm run deploy:folder br_test_folder` (folder name must be prefixed with `br_`))
- You can simply deploy to root of the `gh-pages` branch with: `npm run deploy`.
- You can clean (remove `br_` folders and clear root\) your `gh-pages` branch and deploy to root in a single command with `npm run deploy:clean`
- You can deploy to a folder in your `gh-pages` branch in order to separate from root app deployment and other folder deployments with: `npm run deploy:folder br_test_folder` (folder name must be prefixed with `br_`))

<br />

Expand Down
59 changes: 44 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"file-loader": "^6.2.0",
"history": "^5.0.0",
"gh-pages": "^6.1.1",
"git-revision-webpack-plugin": "^5.0.0",
"history": "^5.0.0",
"html-loader": "^1.3.2",
"html-webpack-plugin": "^5.0.0-beta.5",
"html-webpack-tags-plugin": "^2.0.17",
Expand Down Expand Up @@ -94,12 +94,13 @@
"workbox-webpack-plugin": "^6.0.2"
},
"dependencies": {
"@babel/polyfill": "^7.12.1 ",
"@datadog/browser-rum": "^5.11.0",
"@deriv-com/analytics": "1.28.2",
"@deriv-com/auth-client": "^1.3.10",
"@deriv-com/quill-tokens": "2.0.4",
"@deriv-com/quill-ui": "1.24.4",
"@deriv-com/translations": "1.3.9",
"@deriv-com/auth-client": "1.3.7",
"@deriv-com/ui": "1.36.4",
"@deriv-com/utils": "^0.0.42",
"@deriv/account": "^1.0.0",
Expand All @@ -122,7 +123,6 @@
"@deriv/utils": "^1.0.0",
"@deriv/wallets": "^1.0.0",
"acorn": "^6.1.1",
"@babel/polyfill": "^7.12.1 ",
"canvas-toBlob": "^1.0.0",
"classnames": "^2.2.6",
"crc-32": "^1.2.0",
Expand Down
24 changes: 12 additions & 12 deletions packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
"dependencies": {
"@binary-com/binary-document-uploader": "^2.4.8",
"@deriv-com/analytics": "1.28.2",
"@deriv-com/auth-client": "^1.3.10",
"@deriv-com/ui": "1.36.4",
"@deriv-com/utils": "^0.0.42",
"@deriv/api": "^1.0.0",
"@deriv-com/auth-client": "1.3.7",
"@deriv/stores": "^1.0.0",
"@deriv/utils": "^1.0.0",
"@deriv/shared": "^1.0.0",
"@deriv/stores": "^1.0.0",
"@deriv/translations": "^1.0.0",
"usehooks-ts": "^2.7.0",
"react-i18next": "^11.11.0",
"@deriv/utils": "^1.0.0",
"@simplewebauthn/browser": "^8.3.4",
"@simplewebauthn/typescript-types": "^8.3.4",
"react": "^17.0.2",
"dayjs": "^1.11.11",
"@types/js-cookie": "^3.0.1",
"dayjs": "^1.11.11",
"js-cookie": "^2.2.1",
"@deriv-com/utils": "^0.0.42",
"@deriv-com/ui": "1.36.4"
"react": "^17.0.2",
"react-i18next": "^11.11.0",
"usehooks-ts": "^2.7.0"
},
"devDependencies": {
"typescript": "^4.6.3",
"@testing-library/user-event": "^13.5.0",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^7.0.2"
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/user-event": "^13.5.0",
"typescript": "^4.6.3"
}
}
6 changes: 5 additions & 1 deletion packages/hooks/src/useOauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ const useOauth2 = ({ handleLogout }: { handleLogout: () => Promise<void> }) => {
};

const logoutHandler = async () => {
await OAuth2Logout(handleLogout);
await OAuth2Logout({
WSLogoutAndRedirect: handleLogout,
redirectCallbackUri: `${window.location.origin}/callback`,
postLogoutRedirectUri: `${window.location.origin}/`,
});
};

return { isOAuth2Enabled, oAuthLogout: logoutHandler, loginHandler };
Expand Down

0 comments on commit 81516ee

Please sign in to comment.