integrates new page into company section
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
(:require
|
||||
[auto-ap.graphql.utils :refer [is-admin?]]
|
||||
[buddy.auth :refer [authenticated?]]
|
||||
[auto-ap.logging :as alog]))
|
||||
[auto-ap.logging :as alog]
|
||||
[cemerick.url :as url]))
|
||||
|
||||
(defn wrap-secure [handler]
|
||||
(fn [request]
|
||||
(if (authenticated? request)
|
||||
(handler request)
|
||||
{:status 401
|
||||
:headers {"content-type" "text/html"}
|
||||
:body "not authenticated"})))
|
||||
{:status 302
|
||||
:headers {"Location" "/login" }})))
|
||||
|
||||
(defn wrap-admin [handler]
|
||||
(fn [request]
|
||||
@@ -19,12 +19,11 @@
|
||||
(do
|
||||
(alog/warn ::unauthenticated)
|
||||
{:status 302
|
||||
:headers "/login"}))))
|
||||
:headers {"Location" "/login"}}))))
|
||||
|
||||
(defn wrap-client-redirect-unauthenticated [handler]
|
||||
(fn [request]
|
||||
(let [response (handler request)]
|
||||
(println )
|
||||
(if (= 401 (get response :status))
|
||||
(assoc-in response [:headers "hx-redirect"] "/login/")
|
||||
response))))
|
||||
|
||||
Reference in New Issue
Block a user