|
|
@@ -5,7 +5,6 @@ import (
|
|
|
"fmt"
|
|
|
"net/http"
|
|
|
"strings"
|
|
|
- "time"
|
|
|
|
|
|
"github.com/gorilla/sessions"
|
|
|
"github.com/porter-dev/porter/api/server/shared/apierrors"
|
|
|
@@ -81,19 +80,6 @@ func (authn *AuthN) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- supportEmail := "support@porter.run"
|
|
|
- cancelTime := time.Date(2023, 0o1, 31, 14, 30, 0, 0, time.Now().Local().Location())
|
|
|
- if email, ok := session.Values["email"]; ok {
|
|
|
- if email.(string) == supportEmail {
|
|
|
- sess, _ := authn.config.Repo.Session().SelectSession(&models.Session{Key: session.ID})
|
|
|
- if sess.CreatedAt.Before(cancelTime) {
|
|
|
- _, _ = authn.config.Repo.Session().DeleteSession(sess)
|
|
|
- authn.handleForbiddenForSession(w, r, fmt.Errorf("error, contact admin"), session)
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
if auth, ok := session.Values["authenticated"].(bool); !auth || !ok {
|
|
|
authn.handleForbiddenForSession(w, r, fmt.Errorf("stored cookie was not authenticated"), session)
|
|
|
return
|