From 68d9003f8d8d2adcba43cad6366eca5365110e48 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 5 Apr 2022 21:15:57 +0200 Subject: 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. --- opendc-web/opendc-web-ui/src/pages/_app.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'opendc-web/opendc-web-ui/src/pages/_app.js') 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) { -- cgit v1.2.3