diff --git a/public/index.html b/public/index.html index cc725ef..b67066c 100644 --- a/public/index.html +++ b/public/index.html @@ -3,10 +3,9 @@ - React x Project + Hangman Lab -

wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

\ No newline at end of file diff --git a/src/App.js b/src/App.js index c67b684..b772c44 100644 --- a/src/App.js +++ b/src/App.js @@ -4,6 +4,7 @@ import MainNavigation from "./components/MainNavigation"; import SideNavigation from "./components/SideNavigation"; import MarkdownContent from "./components/MarkdownContent"; import "./App.css"; +import Callback from "./Callback"; const App = () => { return ( @@ -16,6 +17,8 @@ const App = () => { Welcome to My React Project} /> } /> + } /> + TEST}> diff --git a/src/AuthProvider.js b/src/AuthProvider.js index 1ddbc22..7bc1402 100644 --- a/src/AuthProvider.js +++ b/src/AuthProvider.js @@ -21,7 +21,10 @@ const AuthProvider = ({ children }) => { }); }, [userManager]); - const login = () => userManager.signinRedirect(); + const login = () => { + console.log('triggered'); + userManager.signinRedirect().catch((err) => {console.log(err)}); + } const logout = () => userManager.signoutRedirect(); return ( diff --git a/src/components/MainNavigation.js b/src/components/MainNavigation.js index b22e7b7..5626d88 100644 --- a/src/components/MainNavigation.js +++ b/src/components/MainNavigation.js @@ -16,18 +16,18 @@ const MainNavigation = () => { { user && user.profile ? (

{user.profile.name}

- + Logout
) : ( - +
  • + +
  • ) } +
  • - Login -
  • -
  • - + MailBox
  • diff --git a/src/index.js b/src/index.js index af8b522..1d563bb 100644 --- a/src/index.js +++ b/src/index.js @@ -1,8 +1,13 @@ import React from "react"; import ReactDOM from "react-dom/client"; import App from "./App"; +import AuthProvider from "./AuthProvider"; //ReactDOM.render(, document.getElementById("root")); const root = ReactDOM.createRoot(document.getElementById("root")); -root.render(); \ No newline at end of file +root.render( + + + +); \ No newline at end of file diff --git a/src/oicdConfig.js b/src/oicdConfig.js index 700fbbe..be4c018 100644 --- a/src/oicdConfig.js +++ b/src/oicdConfig.js @@ -1,6 +1,6 @@ export const oidcConfig = { - authority: "https://login.hangman-lab.top/auth/realms/myrealm", - client_id: "your-client-id", + authority: "https://login.hangman-lab.top/realms/Hangman-Lab", + client_id: "labdev", redirect_uri: "http://localhost:3000/callback", post_logout_redirect_uri: "http://localhost:3000", response_type: "code", diff --git a/webpack.config.js b/webpack.config.js index fe6d622..2e65d4b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -34,5 +34,6 @@ module.exports = { port: 3000, open: true, hot: true, + historyApiFallback: true, } }; \ No newline at end of file