diff --git a/api/server/authn/handler.go b/api/server/authn/handler.go index 9e3ed898ef..44c0ed4781 100644 --- a/api/server/authn/handler.go +++ b/api/server/authn/handler.go @@ -97,17 +97,20 @@ func (authn *AuthN) ServeHTTP(w http.ResponseWriter, r *http.Request) { } est, err := time.LoadLocation("EST") - if err != nil { - authn.handleForbiddenForSession(w, r, fmt.Errorf("error, contact admin"), session) - return - } - if cancelTokens(time.Date(2024, 0o1, 16, 18, 35, 0, 0, est), "support@porter.run", authn, session) { - authn.handleForbiddenForSession(w, r, fmt.Errorf("error, contact admin"), session) - return - } - if cancelTokens(time.Date(2024, 0o1, 16, 18, 35, 0, 0, est), "admin@porter.run", authn, session) { - authn.handleForbiddenForSession(w, r, fmt.Errorf("error, contact admin"), session) - return + // if err == nil { + // authn.handleForbiddenForSession(w, r, fmt.Errorf("error, contact admin"), session) + // return + // } + // TODO: handle error from time.LoadLocation + if err == nil { + if cancelTokens(time.Date(2024, 0o1, 16, 18, 35, 0, 0, est), "support@porter.run", authn, session) { + authn.handleForbiddenForSession(w, r, fmt.Errorf("error, contact admin"), session) + return + } + if cancelTokens(time.Date(2024, 0o1, 16, 18, 35, 0, 0, est), "admin@porter.run", authn, session) { + authn.handleForbiddenForSession(w, r, fmt.Errorf("error, contact admin"), session) + return + } } if auth, ok := session.Values["authenticated"].(bool); !auth || !ok {