mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 11:36:38 +02:00
♻️ Minor refactor of auth data-flow.
This fixes many issues related to using penpot on-premise instances on different domain than localhost. This changes ensures correct data flow of authenticated and not authenticated sessions.
This commit is contained in:
parent
ece914303a
commit
2596ad27c3
10 changed files with 95 additions and 56 deletions
|
@ -58,7 +58,9 @@
|
|||
(assoc response :cookies {cookie-name {:path "/"
|
||||
:http-only true
|
||||
:value id
|
||||
:same-site (if cors? :none :strict)
|
||||
:same-site (cond (not secure?) :lax
|
||||
cors? :none
|
||||
:else :strict)
|
||||
:secure secure?}})))
|
||||
|
||||
(defn- clear-cookies
|
||||
|
|
|
@ -335,9 +335,9 @@
|
|||
;; --- MUTATION: Logout
|
||||
|
||||
(s/def ::logout
|
||||
(s/keys :req-un [::profile-id]))
|
||||
(s/keys :opt-un [::profile-id]))
|
||||
|
||||
(sv/defmethod ::logout
|
||||
(sv/defmethod ::logout {:auth false}
|
||||
[{:keys [session] :as cfg} _]
|
||||
(with-meta {}
|
||||
{:transform-response (:delete session)}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue