-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
999 additions
and
60 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom' | ||
import { BrowserRouter, Routes, Route } from 'react-router-dom' | ||
|
||
import { Queue } from './pages/Queue' | ||
import { Statistics } from './pages/Statistics' | ||
import { APIKeys } from './pages/APIKeys' | ||
import { PageNotFound } from './pages/PageNotFound' | ||
import { Login } from './pages/Auth/Login' | ||
import { HandleLogin } from './pages/Auth/HandleLogin' | ||
import { LoginRedirect } from './pages/Auth/LoginRedirect' | ||
import { Logout } from './pages/Auth/Logout' | ||
import { AuthRoute } from './pages/Auth/AuthRoute' | ||
import { DefaultLayout } from './layouts/Default' | ||
|
||
function App() { | ||
function App () { | ||
return ( | ||
<Router> | ||
<div className='app'> | ||
<Routes> | ||
<Route path='/' element={<Queue />} /> | ||
<Route path='/statistics' element={<Statistics />} /> | ||
<Route path='/apikeys' element={<APIKeys />} /> | ||
|
||
<Route path='*' element={<PageNotFound />} /> | ||
</Routes> | ||
</div> | ||
</Router> | ||
<BrowserRouter> | ||
<Routes> | ||
<Route path='/login' element={<Login />} /> | ||
<Route path='/handlelogin' element={<HandleLogin />} /> | ||
<Route path='/loginredirect' element={<LoginRedirect />} /> | ||
<Route path='/logout' element={<Logout />} /> | ||
<Route path='/*' element={<AuthRoute><DefaultLayout /></AuthRoute>} /> | ||
</Routes> | ||
</BrowserRouter> | ||
) | ||
} | ||
|
||
export default App; | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
Import modules | ||
*/ | ||
import envToObj from './lib/envToObj' | ||
|
||
/* | ||
Default configuration | ||
*/ | ||
const defaultConfig = { | ||
common: { | ||
loginUrl: '/loginredirect', | ||
storage: 'local', | ||
login: { | ||
type: 'redirect' | ||
} | ||
}, | ||
providers: { | ||
azuread: { | ||
client: { | ||
auth: { | ||
clientId: '[Requred in environment variables]', | ||
authority: 'https://sts.windows.net/08f3813c-9f29-482f-9aec-16ef7cbf477a', | ||
redirectUri: 'http://localhost:3000/handlelogin', | ||
navigateToLoginRequestUrl: false | ||
}, | ||
cache: { | ||
cacheLocation: 'localStorage', | ||
storeAuthStateInCookie: false | ||
} | ||
}, | ||
login: { | ||
scopes: ['clientId/.default'] | ||
} | ||
} | ||
} | ||
} | ||
|
||
const config = envToObj(defaultConfig, { prefixes: 'auth' }) | ||
if (process.env.NODE_ENV === 'development') console.log('Authentication configuration', config) | ||
|
||
export default config |
Oops, something went wrong.