mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
🎉 Add login-with-password flag
As replacement to `login` flag
This commit is contained in:
parent
7f5491f45b
commit
2840cb893e
5 changed files with 11 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
export PENPOT_HOST=devenv
|
||||
export PENPOT_TENANT=dev
|
||||
export PENPOT_FLAGS="$PENPOT_FLAGS enable-backend-asserts enable-audit-log enable-transit-readable-response enable-demo-users disable-secure-session-cookies enable-smtp"
|
||||
export PENPOT_FLAGS="$PENPOT_FLAGS enable-backend-asserts enable-audit-log enable-transit-readable-response enable-demo-users disable-secure-session-cookies enable-smtp enable-webhooks"
|
||||
|
||||
# export PENPOT_DATABASE_URI="postgresql://172.17.0.1:5432/penpot"
|
||||
# export PENPOT_DATABASE_USERNAME="penpot"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
export PENPOT_HOST=devenv
|
||||
export PENPOT_TENANT=dev
|
||||
export PENPOT_FLAGS="$PENPOT_FLAGS enable-backend-asserts enable-audit-log enable-transit-readable-response enable-demo-users disable-secure-session-cookies enable-smtp"
|
||||
export PENPOT_FLAGS="$PENPOT_FLAGS enable-backend-asserts enable-audit-log enable-transit-readable-response enable-demo-users disable-secure-session-cookies enable-smtp enable-webhooks"
|
||||
|
||||
set -ex
|
||||
|
||||
|
|
|
@ -71,7 +71,8 @@
|
|||
(defn login-with-password
|
||||
[{:keys [::db/pool session] :as cfg} {:keys [email password scope] :as params}]
|
||||
|
||||
(when-not (contains? cf/flags :login)
|
||||
(when-not (or (contains? cf/flags :login)
|
||||
(contains? cf/flags :login-with-password))
|
||||
(ex/raise :type :restriction
|
||||
:code :login-disabled
|
||||
:hint "login is disabled in this instance"))
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
(def default
|
||||
"A common flags that affects both: backend and frontend."
|
||||
[:enable-registration
|
||||
:enable-login
|
||||
:enable-webhooks])
|
||||
:enable-login-with-password])
|
||||
|
||||
(defn parse
|
||||
[& flags]
|
||||
|
|
|
@ -171,7 +171,8 @@
|
|||
:label (tr "auth.password")}]]
|
||||
|
||||
[:div.buttons-stack
|
||||
(when (contains? @cf/flags :login)
|
||||
(when (or (contains? @cf/flags :login)
|
||||
(contains? @cf/flags :login-with-password))
|
||||
[:& fm/submit-button
|
||||
{:label (tr "auth.login-submit")
|
||||
:data-test "login-submit"}])
|
||||
|
@ -232,6 +233,7 @@
|
|||
[:& login-buttons {:params params}]
|
||||
|
||||
(when (or (contains? @cf/flags :login)
|
||||
(contains? @cf/flags :login-with-password)
|
||||
(contains? @cf/flags :login-with-ldap))
|
||||
[:span.separator
|
||||
[:span.line]
|
||||
|
@ -239,6 +241,7 @@
|
|||
[:span.line]])])
|
||||
|
||||
(when (or (contains? @cf/flags :login)
|
||||
(contains? @cf/flags :login-with-password)
|
||||
(contains? @cf/flags :login-with-ldap))
|
||||
[:& login-form {:params params :on-success-callback on-success-callback}])])
|
||||
|
||||
|
@ -251,7 +254,8 @@
|
|||
[:& login-methods {:params params}]
|
||||
|
||||
[:div.links
|
||||
(when (contains? @cf/flags :login)
|
||||
(when (or (contains? @cf/flags :login)
|
||||
(contains? @cf/flags :login-with-password))
|
||||
[:div.link-entry
|
||||
[:& lk/link {:action #(st/emit! (rt/nav :auth-recovery-request))
|
||||
:data-test "forgot-password"}
|
||||
|
|
Loading…
Add table
Reference in a new issue