mirror of
https://github.com/penpot/penpot.git
synced 2025-03-19 11:11:21 -05:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
f09cfedebc
5 changed files with 41 additions and 22 deletions
|
@ -30,4 +30,10 @@
|
|||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Open-Color-Scheme.penpot"}
|
||||
{:id "flex-layout-playground"
|
||||
:name "Flex Layout Playground"
|
||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Flex-Layout-Playground.penpot"}]
|
||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Flex-Layout-Playground.penpot"}
|
||||
{:id "prototype-examples"
|
||||
:name "Prototipe template"
|
||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/prototype-examples.penpot"}
|
||||
{:id "penpot-design-system"
|
||||
:name "Design system example"
|
||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Penpot-Design-system.penpot"}]
|
||||
|
|
|
@ -420,12 +420,6 @@
|
|||
|
||||
(defn- get-info
|
||||
[{:keys [::provider ::setup/props] :as cfg} {:keys [params] :as request}]
|
||||
(when-let [error (get params :error)]
|
||||
(ex/raise :type :internal
|
||||
:code :error-on-retrieving-code
|
||||
:error-id error
|
||||
:error-desc (get params :error_description)))
|
||||
|
||||
(let [state (get params :state)
|
||||
code (get params :code)
|
||||
state (tokens/verify props {:token state :iss :oauth})
|
||||
|
@ -609,9 +603,11 @@
|
|||
(defn- callback-handler
|
||||
[cfg request]
|
||||
(try
|
||||
(let [info (get-info cfg request)
|
||||
profile (get-profile cfg info)]
|
||||
(process-callback cfg request info profile))
|
||||
(if-let [error (dm/get-in request [:params :error])]
|
||||
(redirect-with-error "unable-to-auth" error)
|
||||
(let [info (get-info cfg request)
|
||||
profile (get-profile cfg info)]
|
||||
(process-callback cfg request info profile)))
|
||||
(catch Throwable cause
|
||||
(l/err :hint "error on oauth process" :cause cause)
|
||||
(redirect-with-error "unable-to-auth" (ex-message cause)))))
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 318 KiB |
|
@ -299,7 +299,19 @@
|
|||
(ptk/reify ::libraries-fetched
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
(assoc state :builtin-templates libraries))))
|
||||
(let [templates-a-b-test? (cf/external-feature-flag "dashboard-01" "test")
|
||||
remove-ids (if templates-a-b-test?
|
||||
#{"wireframing-kit" "prototype-examples" "plants-app" "penpot-design-system"}
|
||||
#{"prototype-examples" "penpot-design-system"})
|
||||
libraries (cond->> libraries
|
||||
:always
|
||||
(remove #(contains? remove-ids (:id %)))
|
||||
templates-a-b-test?
|
||||
(concat [{:id "wireframing-kit", :name "Wireframe library"}
|
||||
{:id "prototype-examples", :name "Prototype template"}
|
||||
{:id "plants-app", :name "UI mockup example"}
|
||||
{:id "penpot-design-system", :name "Design system example"}]))]
|
||||
(assoc state :builtin-templates libraries)))))
|
||||
|
||||
(defn fetch-builtin-templates
|
||||
[]
|
||||
|
|
|
@ -695,15 +695,20 @@
|
|||
(ptk/reify ::show-redirect-error
|
||||
ptk/WatchEvent
|
||||
(watch [_ _ _]
|
||||
(let [hint (case error
|
||||
"registration-disabled"
|
||||
(tr "errors.registration-disabled")
|
||||
"profile-blocked"
|
||||
(tr "errors.profile-blocked")
|
||||
"auth-provider-not-allowed"
|
||||
(tr "errors.auth-provider-not-allowed")
|
||||
"email-domain-not-allowed"
|
||||
(tr "errors.email-domain-not-allowed")
|
||||
:else
|
||||
(tr "errors.generic"))]
|
||||
(when-let [hint (case error
|
||||
"registration-disabled"
|
||||
(tr "errors.registration-disabled")
|
||||
"profile-blocked"
|
||||
(tr "errors.profile-blocked")
|
||||
"auth-provider-not-allowed"
|
||||
(tr "errors.auth-provider-not-allowed")
|
||||
"email-domain-not-allowed"
|
||||
(tr "errors.email-domain-not-allowed")
|
||||
|
||||
;; We explicitly do not show any error here, it a explicit user operation.
|
||||
"unable-to-auth"
|
||||
nil
|
||||
|
||||
(tr "errors.generic"))]
|
||||
|
||||
(rx/of (msg/warn hint))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue