Skip to content

Commit

Permalink
Merge pull request #348 from PagerDuty/release/0.11.0-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gsreynolds authored Nov 20, 2023
2 parents 3b31516 + 8349395 commit 5b04ea8
Show file tree
Hide file tree
Showing 7 changed files with 310 additions and 416 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: Install Yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

# For Snyk Open Source you must first set up the development environment for your application's dependencies
# For example for Node
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: Node Version
Expand All @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: Node Version
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: Node Version
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "pd-live-react",
"homepage": "https://pagerduty.github.io/pd-live-react",
"version": "0.10.2-beta.0",
"version": "0.11.0-beta.0",
"private": true,
"dependencies": {
"@chakra-ui/icons": "^2.1.0",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.0",
"@datadog/browser-rum": "^4.47.0",
"@emotion/react": "^11.11.1",
Expand All @@ -15,19 +15,19 @@
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@pagerduty/pdjs": "^2.2.3",
"@types/jest": "^29.5.3",
"@types/jest": "^29.5.4",
"@types/node": "^20.5.7",
"@types/react": "^18.2.20",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"axios": "^1.5.0",
"axios": "^1.6.0",
"bootstrap": "^4.6.2",
"bottleneck": "^2.19.5",
"chakra-react-select": "^4.7.0",
"date-fns": "^2.29.3",
"font-awesome": "^4.7.0",
"framer-motion": "^10.16.2",
"fuse.js": "^6.6.2",
"i18next": "^23.4.6",
"i18next": "^23.7.6",
"i18next-browser-languagedetector": "^7.1.0",
"immer": "^10.0.2",
"jsonpath-plus": "^7.2.0",
Expand All @@ -37,7 +37,7 @@
"moment": "^2.29.4",
"pretty-print-error": "^1.1.1",
"react": "^18",
"react-bootstrap": "^2.8.0",
"react-bootstrap": "^2.9.1",
"react-contextmenu": "^2.14.0",
"react-datepicker": "^4.16.0",
"react-dnd": "^16.0.1",
Expand Down Expand Up @@ -103,7 +103,7 @@
"@cypress/react": "^8.0.0",
"@faker-js/faker": "^8.0.2",
"@testing-library/dom": "^9.3.0",
"@testing-library/jest-dom": "^6.0.1",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
Expand All @@ -130,11 +130,11 @@
"eslint-plugin-styled-components-a11y": "^2.1.31",
"genversion": "^3.1.1",
"gh-pages": "^6.0.0",
"i18next-parser": "^8.6.0",
"i18next-parser": "^8.9.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.6.3",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.6.3",
"jest-environment-jsdom": "^29.7.0",
"jest-environment-node": "^29.6.3",
"jest-location-mock": "^1.0.10",
"jest-transformer-svg": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/config/version.js

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

30 changes: 19 additions & 11 deletions src/util/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,31 @@ export const exchangeCodeForToken = async (
codeVerifier,
code,
) => {
// eslint-disable-next-line no-unused-vars
const postData = async (url, _data) => {
const postData = async (url, data) => {
const formData = new URLSearchParams(data); // Convert data to URL-encoded form data
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded', // Set the content type
},
body: formData.toString(), // Convert the form data to a string
});
const json = response.json();
const json = await response.json(); // Parse the response JSON
return json;
};

const requestTokenUrl = 'https://identity.pagerduty.com/oauth/token?'
+ 'grant_type=authorization_code&'
+ `code=${code}&`
+ `redirect_uri=${redirectURL}&`
+ `client_id=${clientId}&`
+ `client_secret=${clientSecret}&`
+ `code_verifier=${codeVerifier}`;
const data = await postData(requestTokenUrl, {});
const requestTokenUrl = 'https://identity.pagerduty.com/oauth/token';
const formData = {
grant_type: 'authorization_code',
code,
redirect_uri: redirectURL,
client_id: clientId,
client_secret: clientSecret,
code_verifier: codeVerifier,
};

const data = await postData(requestTokenUrl, formData);

if (data.access_token) {
return data.access_token;
}
Expand Down
Loading

0 comments on commit 5b04ea8

Please sign in to comment.