summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/pages/_app.js
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-04-05 21:15:57 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-04-06 13:39:32 +0200
commit68d9003f8d8d2adcba43cad6366eca5365110e48 (patch)
tree8e9287ae4c738229e82ace3e9b39d33a2953f490 /opendc-web/opendc-web-ui/src/pages/_app.js
parentf2ff40b5170260289e99e0506525f0905f380907 (diff)
feat(web/ui): Add support for unauthenticated user access
This change updates the web UI and API to support unauthenticated user access. Such functionality is helpful when there is just a single user that wants to try OpenDC.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/pages/_app.js')
-rw-r--r--opendc-web/opendc-web-ui/src/pages/_app.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/opendc-web/opendc-web-ui/src/pages/_app.js b/opendc-web/opendc-web-ui/src/pages/_app.js
index 4861f5c1..bac9a5af 100644
--- a/opendc-web/opendc-web-ui/src/pages/_app.js
+++ b/opendc-web/opendc-web-ui/src/pages/_app.js
@@ -30,6 +30,7 @@ import { AuthProvider, useRequireAuth } from '../auth'
import * as Sentry from '@sentry/react'
import { Integrations } from '@sentry/tracing'
import { QueryClientProvider } from 'react-query'
+import { sentryDsn } from '../config'
import '@patternfly/react-core/dist/styles/base.css'
import '@patternfly/react-styles/css/utilities/Alignment/alignment.css'
@@ -67,17 +68,14 @@ Inner.propTypes = {
}).isRequired,
}
-const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN
// Initialize Sentry if the user has configured a DSN
-if (process.browser && dsn) {
- if (dsn) {
- Sentry.init({
- environment: process.env.NODE_ENV,
- dsn: dsn,
- integrations: [new Integrations.BrowserTracing()],
- tracesSampleRate: 0.1,
- })
- }
+if (process.browser && sentryDsn) {
+ Sentry.init({
+ environment: process.env.NODE_ENV,
+ dsn: sentryDsn,
+ integrations: [new Integrations.BrowserTracing()],
+ tracesSampleRate: 0.1,
+ })
}
export default function App(props) {