From 53be7feee15f7522e1879d17302ec88a6e5a543f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 3 Feb 2021 17:45:45 +0100 Subject: [PATCH] :tada: Add 3rd party auth buttons to register page. --- frontend/src/app/main/ui/auth/login.cljs | 1 + frontend/src/app/main/ui/auth/register.cljs | 33 +++++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/ui/auth/login.cljs b/frontend/src/app/main/ui/auth/login.cljs index ecfa02344..5893eb604 100644 --- a/frontend/src/app/main/ui/auth/login.cljs +++ b/frontend/src/app/main/ui/auth/login.cljs @@ -107,6 +107,7 @@ [:& fm/submit-button {:label (tr "auth.login-submit") :on-click on-submit}] + (when cfg/login-with-ldap [:& fm/submit-button {:label (tr "auth.login-with-ldap-submit") diff --git a/frontend/src/app/main/ui/auth/register.cljs b/frontend/src/app/main/ui/auth/register.cljs index 762db59cc..325fd427a 100644 --- a/frontend/src/app/main/ui/auth/register.cljs +++ b/frontend/src/app/main/ui/auth/register.cljs @@ -18,6 +18,7 @@ [app.main.ui.components.forms :as fm] [app.main.ui.icons :as i] [app.main.ui.messages :as msgs] + [app.main.ui.auth.login :as login] [app.util.dom :as dom] [app.util.i18n :refer [tr t]] [app.util.router :as rt] @@ -130,9 +131,29 @@ :tab-index "4"} (t locale "auth.login-here")]] - (when cfg/allow-demo-users - [:div.link-entry - [:span (t locale "auth.create-demo-profile") " "] - [:a {:on-click #(st/emit! da/create-demo-profile) - :tab-index "5"} - (t locale "auth.create-demo-account")]])]]) + (when cfg/allow-demo-users + [:div.link-entry + [:span (t locale "auth.create-demo-profile") " "] + [:a {:on-click #(st/emit! da/create-demo-profile) + :tab-index "5"} + (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")])]) +