ソースを参照

Removing nil interface conversion (#2888)

* removing nil interface check

* removing file change
Stefan McShane 3 年 前
コミット
864be75f64
1 ファイル変更0 行追加14 行削除
  1. 0 14
      api/server/authn/handler.go

+ 0 - 14
api/server/authn/handler.go

@@ -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