diff --git a/components/Header/Header.jsx b/components/Header/Header.jsx index b6d7a75..2496505 100755 --- a/components/Header/Header.jsx +++ b/components/Header/Header.jsx @@ -5,6 +5,8 @@ export default function Header() { const auth = useAuth(); const navigate = useNavigate(); + console.log(auth); + return (

navigate("/")}>Raman spectra search

@@ -22,7 +24,11 @@ export default function Header() { @@ -31,7 +37,9 @@ export default function Header() { diff --git a/src/main.jsx b/src/main.jsx index f01abf8..be41f34 100755 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,7 +1,6 @@ -import React, { useEffect, useState } from "react"; +import React, { useEffect } from "react"; +import { AuthProvider, useAuth } from "react-oidc-context"; import { createBrowserRouter, RouterProvider } from "react-router-dom"; -import { AuthProvider } from "react-oidc-context"; -import { useAuth } from "react-oidc-context"; import ReactDOM from "react-dom/client"; import App from "./App.jsx"; @@ -11,7 +10,7 @@ const oidcConfig = { authority: "https://iam.ideaconsult.net/auth/realms/nano", client_id: "idea-ui", redirect_uri: window.location.origin + "/search/", - post_logout_redirect_uri: "https://iam.ideaconsult.net/", + post_logout_redirect_uri: window.location.origin + "/search/", response_type: "code", scope: "openid profile email", }; @@ -38,9 +37,12 @@ const Main = () => { const registerServiceWorker = async () => { if ("serviceWorker" in navigator) { try { - const registration = await navigator.serviceWorker.register(base_url, { - scope: "/search/", - }); + const registration = await navigator.serviceWorker.register( + "/search/serviceWorker.js", + { + scope: "/search/", + } + ); await registration.active.postMessage({ type: "TOKEN",