mirror of
https://github.com/penpot/penpot.git
synced 2025-05-14 19:36:38 +02:00
🐛 Disable authentication for :login-or-register.
This commit is contained in:
parent
6f5b18de3a
commit
fdd36d48bc
3 changed files with 9 additions and 2 deletions
|
@ -38,6 +38,11 @@
|
||||||
{:status 403
|
{:status 403
|
||||||
:body (ex-data err)})
|
:body (ex-data err)})
|
||||||
|
|
||||||
|
(defmethod handle-exception :authentication
|
||||||
|
[err _]
|
||||||
|
{:status 401
|
||||||
|
:body (ex-data err)})
|
||||||
|
|
||||||
(defmethod handle-exception :validation
|
(defmethod handle-exception :validation
|
||||||
[err req]
|
[err req]
|
||||||
(let [header (get-in req [:headers "accept"])
|
(let [header (get-in req [:headers "accept"])
|
||||||
|
|
|
@ -68,7 +68,9 @@
|
||||||
(log/debugf "Registering '%s' command to rpc service." (::sv/name mdata))
|
(log/debugf "Registering '%s' command to rpc service." (::sv/name mdata))
|
||||||
(fn [params]
|
(fn [params]
|
||||||
(when (and (:auth mdata true) (not (uuid? (:profile-id params))))
|
(when (and (:auth mdata true) (not (uuid? (:profile-id params))))
|
||||||
(ex/raise :type :not-authenticated))
|
(ex/raise :type :authentication
|
||||||
|
:code :authentication-required
|
||||||
|
:hint "authentication required for this endpoint"
|
||||||
(f cfg (us/conform spec params)))))
|
(f cfg (us/conform spec params)))))
|
||||||
|
|
||||||
(defn- process-method
|
(defn- process-method
|
||||||
|
|
|
@ -228,7 +228,7 @@
|
||||||
|
|
||||||
;; --- Mutation: Register if not exists
|
;; --- Mutation: Register if not exists
|
||||||
|
|
||||||
(sv/defmethod ::login-or-register
|
(sv/defmethod ::login-or-register {:auth false}
|
||||||
[{:keys [pool] :as cfg} {:keys [email fullname] :as params}]
|
[{:keys [pool] :as cfg} {:keys [email fullname] :as params}]
|
||||||
(letfn [(populate-additional-data [conn profile]
|
(letfn [(populate-additional-data [conn profile]
|
||||||
(let [data (profile/retrieve-additional-data conn (:id profile))]
|
(let [data (profile/retrieve-additional-data conn (:id profile))]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue