-
+
+ );
+};
\ No newline at end of file
diff --git a/frontend/src/components/OAuth2Page/OAuth2Page.tsx b/frontend/src/components/OAuth2Page/OAuth2Page.tsx
new file mode 100644
index 0000000..7ae1daa
--- /dev/null
+++ b/frontend/src/components/OAuth2Page/OAuth2Page.tsx
@@ -0,0 +1,31 @@
+import React, { useEffect } from 'react';
+import { Page } from '../Page';
+import { useDispatch } from 'react-redux';
+import { logout, login, handleOAuth2Callback } from '../../store/actions/auth';
+
+export function OAuth2Page({ match, location, history }) {
+ const dispatch = useDispatch();
+ const { action } = match.params;
+
+ useEffect(() => {
+ switch(action) {
+ case 'logout':
+ dispatch(logout());
+ history.push("/");
+ break;
+ case 'login':
+ dispatch(login());
+ break;
+ case 'callback':
+ dispatch(handleOAuth2Callback(location.search));
+ history.push("/");
+ break;
+ }
+ }, [action]);
+
+ return (
+
+
+
+ );
+}
diff --git a/frontend/src/config.ts b/frontend/src/config.ts
new file mode 100644
index 0000000..9b59e24
--- /dev/null
+++ b/frontend/src/config.ts
@@ -0,0 +1,20 @@
+export const Config = {
+ // The OpenID Connect client_id
+ oauth2ClientId: get
("oauth2ClientId", "daddy"),
+ oauth2Scope: get("oauth2Scope", "email email_verified openid offline_access"),
+ oauth2RedirectURI: get("oauth2RedirectURI", "http://localhost:8081/oauth2/callback"),
+ oauth2Audience: get("oauth2Audience", ""),
+ oauth2AuthorizeURL: get("oauth2AuthorizeURL", "http://localhost:4444/oauth2/auth"),
+ oauth2TokenURL: get("oauth2TokenURL", "http://localhost:4444/oauth2/token"),
+ oauth2LogoutURL: get("oauth2LogoutURL", "http://localhost:4444/oauth2/sessions/logout"),
+ oauth2PostLogoutRedirectURI: get("oauth2PostLogoutRedirectURI", "http://localhost:8081")
+};
+
+function get(key: string, defaultValue: T):T {
+ const config = window['__CONFIG__'] || {};
+ if (config && config.hasOwnProperty(key)) {
+ return config[key] as T;
+ } else {
+ return defaultValue;
+ }
+}
\ No newline at end of file
diff --git a/frontend/src/index.html b/frontend/src/index.html
index 234eb2a..9089b6a 100644
--- a/frontend/src/index.html
+++ b/frontend/src/index.html
@@ -5,16 +5,18 @@
Daddy
<% for (var css in htmlWebpackPlugin.files.css) { %>
-
+
<% } %>
<% if (htmlWebpackPlugin.files.favicon) { %>
-
+
<% } %>
+
+
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
-
+
<% } %>