diff --git a/web/package/agama-web-ui.changes b/web/package/agama-web-ui.changes index 0ab75f8d40..8be41863b7 100644 --- a/web/package/agama-web-ui.changes +++ b/web/package/agama-web-ui.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jun 14 07:37:58 UTC 2024 - David Diaz + +- Do not redirect to login page until really needed + (gh#openSUSE/agama#1340). + ------------------------------------------------------------------- Fri Jun 14 05:34:52 UTC 2024 - Imobach Gonzalez Sosa diff --git a/web/src/Protected.jsx b/web/src/Protected.jsx index 0b2a9c5f99..2f83011247 100644 --- a/web/src/Protected.jsx +++ b/web/src/Protected.jsx @@ -27,7 +27,7 @@ import { AppProviders } from "./context/app"; export default function Protected() { const { isLoggedIn } = useAuth(); - if (isLoggedIn !== true) { + if (isLoggedIn === false) { return ; } diff --git a/web/src/context/auth.jsx b/web/src/context/auth.jsx index 74c528c721..90cdde5933 100644 --- a/web/src/context/auth.jsx +++ b/web/src/context/auth.jsx @@ -48,7 +48,7 @@ const AuthErrors = Object.freeze({ * @param {React.ReactNode} [props.children] - content to display within the provider */ function AuthProvider({ children }) { - const [isLoggedIn, setIsLoggedIn] = useState(false); + const [isLoggedIn, setIsLoggedIn] = useState(undefined); const [error, setError] = useState(null); const login = useCallback(async (password) => {