Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 14 07:37:58 UTC 2024 - David Diaz <dgonzalez@suse.com>

- Do not redirect to login page until really needed
(gh#openSUSE/agama#1340).

-------------------------------------------------------------------
Fri Jun 14 05:34:52 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion web/src/Protected.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { AppProviders } from "./context/app";
export default function Protected() {
const { isLoggedIn } = useAuth();

if (isLoggedIn !== true) {
if (isLoggedIn === false) {
return <Navigate to="/login" />;
}

Expand Down
2 changes: 1 addition & 1 deletion web/src/context/auth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down