import React from 'react'; import { BrowserRouter } from 'react-router-dom'; import { AuthorizerProvider } from '@authorizerdev/authorizer-react'; import Root from './Root'; import { createRandomString } from './utils/common'; declare global { interface Window { __authorizer__: any; } } export default function App() { const searchParams = new URLSearchParams(window.location.search); const state = searchParams.get('state') || createRandomString(); const scope = searchParams.get('scope') ? searchParams.get('scope')?.toString().split(' ') : `openid profile email`; const urlProps: Record = { state, scope, }; const redirectURL = searchParams.get('redirect_uri') || searchParams.get('redirectURL'); if (redirectURL) { urlProps.redirectURL = redirectURL; } else { urlProps.redirectURL = window.location.origin + '/app'; } const globalState: Record = { ...window['__authorizer__'], ...urlProps, }; return (
logo

{globalState.organizationName}

); }