🎉 Add 3rd party auth buttons to register page.

This commit is contained in:
Andrey Antukh 2021-02-03 17:45:45 +01:00 committed by Hirunatan
parent e182cc4028
commit 53be7feee1
2 changed files with 28 additions and 6 deletions

View file

@ -107,6 +107,7 @@
[:& fm/submit-button [:& fm/submit-button
{:label (tr "auth.login-submit") {:label (tr "auth.login-submit")
:on-click on-submit}] :on-click on-submit}]
(when cfg/login-with-ldap (when cfg/login-with-ldap
[:& fm/submit-button [:& fm/submit-button
{:label (tr "auth.login-with-ldap-submit") {:label (tr "auth.login-with-ldap-submit")

View file

@ -18,6 +18,7 @@
[app.main.ui.components.forms :as fm] [app.main.ui.components.forms :as fm]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
[app.main.ui.messages :as msgs] [app.main.ui.messages :as msgs]
[app.main.ui.auth.login :as login]
[app.util.dom :as dom] [app.util.dom :as dom]
[app.util.i18n :refer [tr t]] [app.util.i18n :refer [tr t]]
[app.util.router :as rt] [app.util.router :as rt]
@ -135,4 +136,24 @@
[:span (t locale "auth.create-demo-profile") " "] [:span (t locale "auth.create-demo-profile") " "]
[:a {:on-click #(st/emit! da/create-demo-profile) [:a {:on-click #(st/emit! da/create-demo-profile)
:tab-index "5"} :tab-index "5"}
(t locale "auth.create-demo-account")]])]]) (t locale "auth.create-demo-account")]])]
(when cfg/google-client-id
[:a.btn-ocean.btn-large.btn-google-auth
{:on-click login/login-with-google}
"Login with Google"])
(when cfg/gitlab-client-id
[:a.btn-ocean.btn-large.btn-gitlab-auth
{:on-click login/login-with-gitlab}
[:img.logo
{:src "/images/icons/brand-gitlab.svg"}]
(tr "auth.login-with-gitlab-submit")])
(when cfg/github-client-id
[:a.btn-ocean.btn-large.btn-github-auth
{:on-click login/login-with-github}
[:img.logo
{:src "/images/icons/brand-github.svg"}]
(tr "auth.login-with-github-submit")])])