mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
ddea31193b
OpenID connect has become a standard when it comes to authentication and in order to fix a security concern around forwarding authentication and authorization information it has been decided to add support for it. This feature is in beta version and only enabled when there is a configuration for it. Before enabling it in production, please consider that it's in beta with potential bugs and that there are several production critical features still missing such as all OIDC related data is stored in configuration or memory. This means you are potentially going to experience issues with HA deployments, or when restarting a single instance specifically related to OIDC. We are still working on adding the remaining set of features before making it GA as soon as possible. Related to #189 Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>
87 lines
3.4 KiB
TypeScript
87 lines
3.4 KiB
TypeScript
import React, { useState } from "react";
|
|
|
|
import { config as faConfig } from "@fortawesome/fontawesome-svg-core";
|
|
import { CssBaseline, ThemeProvider } from "@material-ui/core";
|
|
import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom";
|
|
|
|
import NotificationBar from "./components/NotificationBar";
|
|
import NotificationsContext from "./hooks/NotificationsContext";
|
|
import { Notification } from "./models/Notifications";
|
|
import {
|
|
FirstFactorRoute,
|
|
ResetPasswordStep2Route,
|
|
ResetPasswordStep1Route,
|
|
RegisterSecurityKeyRoute,
|
|
RegisterOneTimePasswordRoute,
|
|
LogoutRoute,
|
|
ConsentRoute,
|
|
} from "./Routes";
|
|
import * as themes from "./themes";
|
|
import { getBasePath } from "./utils/BasePath";
|
|
import { getRememberMe, getResetPassword, getTheme } from "./utils/Configuration";
|
|
import RegisterOneTimePassword from "./views/DeviceRegistration/RegisterOneTimePassword";
|
|
import RegisterSecurityKey from "./views/DeviceRegistration/RegisterSecurityKey";
|
|
import ConsentView from "./views/LoginPortal/ConsentView/ConsentView";
|
|
import LoginPortal from "./views/LoginPortal/LoginPortal";
|
|
import SignOut from "./views/LoginPortal/SignOut/SignOut";
|
|
import ResetPasswordStep1 from "./views/ResetPassword/ResetPasswordStep1";
|
|
import ResetPasswordStep2 from "./views/ResetPassword/ResetPasswordStep2";
|
|
|
|
import "@fortawesome/fontawesome-svg-core/styles.css";
|
|
|
|
faConfig.autoAddCss = false;
|
|
|
|
function Theme() {
|
|
switch (getTheme()) {
|
|
case "dark":
|
|
return themes.Dark;
|
|
case "grey":
|
|
return themes.Grey;
|
|
default:
|
|
return themes.Light;
|
|
}
|
|
}
|
|
|
|
const App: React.FC = () => {
|
|
const [notification, setNotification] = useState(null as Notification | null);
|
|
|
|
return (
|
|
<ThemeProvider theme={Theme()}>
|
|
<CssBaseline />
|
|
<NotificationsContext.Provider value={{ notification, setNotification }}>
|
|
<Router basename={getBasePath()}>
|
|
<NotificationBar onClose={() => setNotification(null)} />
|
|
<Switch>
|
|
<Route path={ResetPasswordStep1Route} exact>
|
|
<ResetPasswordStep1 />
|
|
</Route>
|
|
<Route path={ResetPasswordStep2Route} exact>
|
|
<ResetPasswordStep2 />
|
|
</Route>
|
|
<Route path={RegisterSecurityKeyRoute} exact>
|
|
<RegisterSecurityKey />
|
|
</Route>
|
|
<Route path={RegisterOneTimePasswordRoute} exact>
|
|
<RegisterOneTimePassword />
|
|
</Route>
|
|
<Route path={LogoutRoute} exact>
|
|
<SignOut />
|
|
</Route>
|
|
<Route path={ConsentRoute} exact>
|
|
<ConsentView />
|
|
</Route>
|
|
<Route path={FirstFactorRoute}>
|
|
<LoginPortal rememberMe={getRememberMe()} resetPassword={getResetPassword()} />
|
|
</Route>
|
|
<Route path="/">
|
|
<Redirect to={FirstFactorRoute} />
|
|
</Route>
|
|
</Switch>
|
|
</Router>
|
|
</NotificationsContext.Provider>
|
|
</ThemeProvider>
|
|
);
|
|
};
|
|
|
|
export default App;
|