From aef31c8b509250071d53e757aa36b19ef65b53c2 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Fri, 10 Apr 2020 08:41:09 +1000 Subject: [PATCH] Don't redirect login to migrate page (#453) --- pkg/api/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/api/server.go b/pkg/api/server.go index 9dadd2571..6e2328c00 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -383,7 +383,8 @@ func DatabaseCheckMiddleware(next http.Handler) http.Handler { ext := path.Ext(r.URL.Path) shouldRedirect := ext == "" && r.Method == "GET" if shouldRedirect && database.NeedsMigration() { - if !strings.HasPrefix(r.URL.Path, "/migrate") { + // #451 - don't redirect if loading login page + if !strings.HasPrefix(r.URL.Path, "/migrate") && !strings.HasPrefix(r.URL.Path, "/login") { http.Redirect(w, r, "/migrate", 301) return }