From 9532447271a10b527a424d8546d33c68679d6ab3 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Sat, 13 Sep 2025 10:29:04 +0200 Subject: [PATCH 1/2] ci: don't use GOTOOLCHAIN for getting gotify/build image The setup-go action, sets GOTOOLCHAIN=local and breaks the release build. --- Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5bc5cfa..4ebe090 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,7 @@ LICENSE_DIR=./licenses/ BUILD_DIR=./build DOCKER_DIR=./docker/ SHELL := /bin/bash -ifdef GOTOOLCHAIN - GO_VERSION=$(GOTOOLCHAIN) -else - GO_VERSION=$(shell go mod edit -json | jq -r .Toolchain | sed -e 's/go//') -endif +GO_VERSION=$(shell go mod edit -json | jq -r .Toolchain | sed -e 's/go//') DOCKER_BUILD_IMAGE=docker.io/gotify/build DOCKER_WORKDIR=/proj DOCKER_RUN=docker run --rm -e LD_FLAGS="$$LD_FLAGS" -v "$$PWD/.:${DOCKER_WORKDIR}" -v "`go env GOPATH`/pkg/mod/.:/go/pkg/mod:ro" -w ${DOCKER_WORKDIR} From b394578a185ffd7ab26dfdde5cb9f974fe3cf281 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Sat, 13 Sep 2025 10:34:07 +0200 Subject: [PATCH 2/2] fix: preserve url path when refreshing the page Don't redirect to /#/login when the tryAuthenticate hasn't completed. This caused the url path to be changed to /#/login regardaless if the user was already logged in. --- ui/src/layout/Layout.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ui/src/layout/Layout.tsx b/ui/src/layout/Layout.tsx index 75f6cc1..7840cb4 100644 --- a/ui/src/layout/Layout.tsx +++ b/ui/src/layout/Layout.tsx @@ -55,6 +55,7 @@ const Layout = observer(() => { const { currentUser: { loggedIn, + authenticating, user: {name, admin}, logout, tryReconnect, @@ -79,7 +80,9 @@ const Layout = observer(() => { }; const authed = (children: React.ReactNode) => ( - {children} + + {children} + ); return ( @@ -167,11 +170,16 @@ const Lazy = ({component}: {component: () => Promise<{default: React.ComponentTy ); }; -const RequireAuth: React.FC> = ({ - children, - loggedIn, -}) => { - return loggedIn ? <>{children} : ; +const RequireAuth: React.FC< + React.PropsWithChildren<{loggedIn: boolean; authenticating: boolean}> +> = ({children, authenticating, loggedIn}) => { + if (authenticating) { + return ; + } + if (!loggedIn) { + return ; + } + return <>{children}; }; export default Layout;