diff --git a/package-lock.json b/package-lock.json index b0a539765..1f1b6b105 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@navikt/arbeidsplassen-core": "2.0.0", "@navikt/arbeidsplassen-knapper": "2.0.2", - "@sentry/browser": "^5.20.1", + "@sentry/browser": "^6.19.6", "@types/react-router-dom": "^4.3.5", "amplitude-js": "^8.5.0", "body-parser": "^1.19.0", @@ -244,13 +244,13 @@ } }, "node_modules/@sentry/browser": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.20.1.tgz", - "integrity": "sha512-ClykuvrEsMKgAvifx5VHzRjchwYbJFX8YiIicYx+Wr3MXL2jLG6OEfHHJwJeyBL2C3vxd5O0KPK3pGMR9wPMLA==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-6.19.6.tgz", + "integrity": "sha512-V5QyY1cO1iuFCI78dOFbHV7vckbeQEPPq3a5dGSXlBQNYnd9Ec5xoxp5nRNpWQPOZ8/Ixt9IgRxdqVTkWib51g==", "dependencies": { - "@sentry/core": "5.20.1", - "@sentry/types": "5.20.1", - "@sentry/utils": "5.20.1", + "@sentry/core": "6.19.6", + "@sentry/types": "6.19.6", + "@sentry/utils": "6.19.6", "tslib": "^1.9.3" }, "engines": { @@ -258,14 +258,14 @@ } }, "node_modules/@sentry/core": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.20.1.tgz", - "integrity": "sha512-gG622/UY2TePruF6iUzgVrbIX5vN8w2cjlWFo1Est8MvCfQsz8agGaLMCAyl5hCGJ6K2qTUZDOlbCNIKoMclxg==", - "dependencies": { - "@sentry/hub": "5.20.1", - "@sentry/minimal": "5.20.1", - "@sentry/types": "5.20.1", - "@sentry/utils": "5.20.1", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.19.6.tgz", + "integrity": "sha512-biEotGRr44/vBCOegkTfC9rwqaqRKIpFljKGyYU6/NtzMRooktqOhjmjmItNCMRknArdeaQwA8lk2jcZDXX3Og==", + "dependencies": { + "@sentry/hub": "6.19.6", + "@sentry/minimal": "6.19.6", + "@sentry/types": "6.19.6", + "@sentry/utils": "6.19.6", "tslib": "^1.9.3" }, "engines": { @@ -273,12 +273,12 @@ } }, "node_modules/@sentry/hub": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.20.1.tgz", - "integrity": "sha512-Nv5BXf14BEc08acDguW6eSqkAJLVf8wki283FczEvTsQZZuSBHM9cJ5Hnehr6n+mr8wWpYLgUUYM0oXXigUmzQ==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.19.6.tgz", + "integrity": "sha512-PuEOBZxvx3bjxcXmWWZfWXG+orojQiWzv9LQXjIgroVMKM/GG4QtZbnWl1hOckUj7WtKNl4hEGO2g/6PyCV/vA==", "dependencies": { - "@sentry/types": "5.20.1", - "@sentry/utils": "5.20.1", + "@sentry/types": "6.19.6", + "@sentry/utils": "6.19.6", "tslib": "^1.9.3" }, "engines": { @@ -286,12 +286,12 @@ } }, "node_modules/@sentry/minimal": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.20.1.tgz", - "integrity": "sha512-2PeJKDTHNsUd1jtSLQBJ6oRI+xrIJrYDQmsyK/qs9D7HqHfs+zNAMUjYseiVeSAFGas5IcNSuZbPRV4BnuoZ0w==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.19.6.tgz", + "integrity": "sha512-T1NKcv+HTlmd8EbzUgnGPl4ySQGHWMCyZ8a8kXVMZOPDzphN3fVIzkYzWmSftCWp0rpabXPt9aRF2mfBKU+mAQ==", "dependencies": { - "@sentry/hub": "5.20.1", - "@sentry/types": "5.20.1", + "@sentry/hub": "6.19.6", + "@sentry/types": "6.19.6", "tslib": "^1.9.3" }, "engines": { @@ -299,19 +299,19 @@ } }, "node_modules/@sentry/types": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.20.1.tgz", - "integrity": "sha512-OU+i/lcjGpDJv0XkNpsKrI2r1VPp8qX0H6Knq8NuZrlZe3AbvO3jRJJK0pH14xFv8Xok5jbZZpKKoQLxYfxqsw==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.19.6.tgz", + "integrity": "sha512-QH34LMJidEUPZK78l+Frt3AaVFJhEmIi05Zf8WHd9/iTt+OqvCHBgq49DDr1FWFqyYWm/QgW/3bIoikFpfsXyQ==", "engines": { "node": ">=6" } }, "node_modules/@sentry/utils": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.20.1.tgz", - "integrity": "sha512-dhK6IdO6g7Q2CoxCbB+q8gwUapDUH5VjraFg0UBzgkrtNhtHLylqmwx0sWQvXCcp14Q/3MuzEbb4euvoh8o8oA==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.19.6.tgz", + "integrity": "sha512-fAMWcsguL0632eWrROp/vhPgI7sBj/JROWVPzpabwVkm9z3m1rQm6iLFn4qfkZL8Ozy6NVZPXOQ7EXmeU24byg==", "dependencies": { - "@sentry/types": "5.20.1", + "@sentry/types": "6.19.6", "tslib": "^1.9.3" }, "engines": { @@ -9433,59 +9433,59 @@ } }, "@sentry/browser": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.20.1.tgz", - "integrity": "sha512-ClykuvrEsMKgAvifx5VHzRjchwYbJFX8YiIicYx+Wr3MXL2jLG6OEfHHJwJeyBL2C3vxd5O0KPK3pGMR9wPMLA==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-6.19.6.tgz", + "integrity": "sha512-V5QyY1cO1iuFCI78dOFbHV7vckbeQEPPq3a5dGSXlBQNYnd9Ec5xoxp5nRNpWQPOZ8/Ixt9IgRxdqVTkWib51g==", "requires": { - "@sentry/core": "5.20.1", - "@sentry/types": "5.20.1", - "@sentry/utils": "5.20.1", + "@sentry/core": "6.19.6", + "@sentry/types": "6.19.6", + "@sentry/utils": "6.19.6", "tslib": "^1.9.3" } }, "@sentry/core": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.20.1.tgz", - "integrity": "sha512-gG622/UY2TePruF6iUzgVrbIX5vN8w2cjlWFo1Est8MvCfQsz8agGaLMCAyl5hCGJ6K2qTUZDOlbCNIKoMclxg==", - "requires": { - "@sentry/hub": "5.20.1", - "@sentry/minimal": "5.20.1", - "@sentry/types": "5.20.1", - "@sentry/utils": "5.20.1", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.19.6.tgz", + "integrity": "sha512-biEotGRr44/vBCOegkTfC9rwqaqRKIpFljKGyYU6/NtzMRooktqOhjmjmItNCMRknArdeaQwA8lk2jcZDXX3Og==", + "requires": { + "@sentry/hub": "6.19.6", + "@sentry/minimal": "6.19.6", + "@sentry/types": "6.19.6", + "@sentry/utils": "6.19.6", "tslib": "^1.9.3" } }, "@sentry/hub": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.20.1.tgz", - "integrity": "sha512-Nv5BXf14BEc08acDguW6eSqkAJLVf8wki283FczEvTsQZZuSBHM9cJ5Hnehr6n+mr8wWpYLgUUYM0oXXigUmzQ==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.19.6.tgz", + "integrity": "sha512-PuEOBZxvx3bjxcXmWWZfWXG+orojQiWzv9LQXjIgroVMKM/GG4QtZbnWl1hOckUj7WtKNl4hEGO2g/6PyCV/vA==", "requires": { - "@sentry/types": "5.20.1", - "@sentry/utils": "5.20.1", + "@sentry/types": "6.19.6", + "@sentry/utils": "6.19.6", "tslib": "^1.9.3" } }, "@sentry/minimal": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.20.1.tgz", - "integrity": "sha512-2PeJKDTHNsUd1jtSLQBJ6oRI+xrIJrYDQmsyK/qs9D7HqHfs+zNAMUjYseiVeSAFGas5IcNSuZbPRV4BnuoZ0w==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.19.6.tgz", + "integrity": "sha512-T1NKcv+HTlmd8EbzUgnGPl4ySQGHWMCyZ8a8kXVMZOPDzphN3fVIzkYzWmSftCWp0rpabXPt9aRF2mfBKU+mAQ==", "requires": { - "@sentry/hub": "5.20.1", - "@sentry/types": "5.20.1", + "@sentry/hub": "6.19.6", + "@sentry/types": "6.19.6", "tslib": "^1.9.3" } }, "@sentry/types": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.20.1.tgz", - "integrity": "sha512-OU+i/lcjGpDJv0XkNpsKrI2r1VPp8qX0H6Knq8NuZrlZe3AbvO3jRJJK0pH14xFv8Xok5jbZZpKKoQLxYfxqsw==" + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.19.6.tgz", + "integrity": "sha512-QH34LMJidEUPZK78l+Frt3AaVFJhEmIi05Zf8WHd9/iTt+OqvCHBgq49DDr1FWFqyYWm/QgW/3bIoikFpfsXyQ==" }, "@sentry/utils": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.20.1.tgz", - "integrity": "sha512-dhK6IdO6g7Q2CoxCbB+q8gwUapDUH5VjraFg0UBzgkrtNhtHLylqmwx0sWQvXCcp14Q/3MuzEbb4euvoh8o8oA==", + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.19.6.tgz", + "integrity": "sha512-fAMWcsguL0632eWrROp/vhPgI7sBj/JROWVPzpabwVkm9z3m1rQm6iLFn4qfkZL8Ozy6NVZPXOQ7EXmeU24byg==", "requires": { - "@sentry/types": "5.20.1", + "@sentry/types": "6.19.6", "tslib": "^1.9.3" } }, diff --git a/package.json b/package.json index 6613a17a9..60a217788 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "@navikt/arbeidsplassen-core": "2.0.0", "@navikt/arbeidsplassen-knapper": "2.0.2", - "@sentry/browser": "^5.20.1", + "@sentry/browser": "^6.19.6", "@types/react-router-dom": "^4.3.5", "amplitude-js": "^8.5.0", "body-parser": "^1.19.0", diff --git a/src/context/AuthenticationProvider.js b/src/context/AuthenticationProvider.js index 4cf268c1c..77f45903f 100644 --- a/src/context/AuthenticationProvider.js +++ b/src/context/AuthenticationProvider.js @@ -22,24 +22,6 @@ const allowedRedirectUrls = [ CONTEXT_PATH ]; -/** - * Om man logget inn mens man var inne på en stillingsannonse, så vil loginservice - * redirecte til en url med dette url-formatet: '/stillinger/stilling?uuid=12345'. - * Redirecter derfor til riktig url-format: '/stillinger/stilling/:uuid' - */ -export function fixUrlAfterLogin() { - if (window.location.pathname === `${CONTEXT_PATH}/stilling`) { - const uuid = extractParam('uuid'); - window.history.replaceState( - {}, - "", - `${CONTEXT_PATH}/stilling/${uuid}` - ); - } else if (window.location.pathname === `${CONTEXT_PATH}/intern`) { - const uuid = extractParam('uuid'); - window.history.replaceState({}, "", `${CONTEXT_PATH}/intern/${uuid}`); - } -} const AuthenticationProvider = ({ children }) => { const [authenticationStatus, setAuthenticationStatus] = useState(AuthenticationStatus.NOT_FETCHED); @@ -151,3 +133,23 @@ AuthenticationProvider.propTypes = { }; export default AuthenticationProvider; + + +/** + * Om man logget inn mens man var inne på en stillingsannonse, så vil loginservice + * redirecte til en url med dette url-formatet: '/stillinger/stilling?uuid=12345'. + * Redirecter derfor til riktig url-format: '/stillinger/stilling/:uuid' + */ +export function fixUrlAfterLogin() { + if (window.location.pathname === `${CONTEXT_PATH}/stilling`) { + const uuid = extractParam('uuid'); + window.history.replaceState( + {}, + "", + `${CONTEXT_PATH}/stilling/${uuid}` + ); + } else if (window.location.pathname === `${CONTEXT_PATH}/intern`) { + const uuid = extractParam('uuid'); + window.history.replaceState({}, "", `${CONTEXT_PATH}/intern/${uuid}`); + } +} \ No newline at end of file