From ba663aeafccca79502e72cc44d192be3bdce138c Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Mon, 14 Aug 2023 21:07:40 +0300 Subject: [PATCH] feat: remove login divider, add config option for oidc visual in login --- config/config.go | 4 ++++ handlers/login.go | 3 ++- static/styles.css | 28 ++++++++++++++-------------- template/templates/login.tmpl | 7 +------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/config/config.go b/config/config.go index f999cdd..0469ca6 100644 --- a/config/config.go +++ b/config/config.go @@ -26,6 +26,8 @@ type Config struct { OidcDomain string OidcClientID string OidcSecret string + // What is written on the login button + OidcLoginVisual string } func ParseConfig() { @@ -46,5 +48,7 @@ func ParseConfig() { OidcDomain: util.LoadVar("TIXE_OIDC_DOMAIN", ""), OidcClientID: util.LoadVar("TIXE_OIDC_CLIENTID", ""), OidcSecret: util.LoadVar("TIXE_OIDC_SECRET", ""), + + OidcLoginVisual: util.LoadVar("TIXE_OIDC_LOGIN_VISUAL", "oidc"), } } diff --git a/handlers/login.go b/handlers/login.go index a9f4191..46361d7 100644 --- a/handlers/login.go +++ b/handlers/login.go @@ -2,12 +2,13 @@ package handlers import ( "net/http" + "tixe/config" "tixe/template" "github.com/gin-gonic/gin" ) func Login(c *gin.Context) { - html := template.TmplEngine.Render("login.tmpl", map[string]interface{}{"notauthed": true}) + html := template.TmplEngine.Render("login.tmpl", map[string]interface{}{"notauthed": true, "oidcloginvisual": config.TixeConfig.OidcLoginVisual}) c.Data(http.StatusOK, "text/html", html) } diff --git a/static/styles.css b/static/styles.css index 17d8a51..63d8921 100644 --- a/static/styles.css +++ b/static/styles.css @@ -549,14 +549,14 @@ video { min-width: max-content; } -.max-w-4xl { - max-width: 56rem; -} - .max-w-3xl { max-width: 48rem; } +.max-w-4xl { + max-width: 56rem; +} + .grow { flex-grow: 1; } @@ -618,18 +618,18 @@ video { background-image: linear-gradient(to right, var(--tw-gradient-stops)); } -.from-slate-600 { - --tw-gradient-from: #475569 var(--tw-gradient-from-position); - --tw-gradient-to: rgb(71 85 105 / 0) var(--tw-gradient-to-position); - --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); -} - .from-neutral-500 { --tw-gradient-from: #737373 var(--tw-gradient-from-position); --tw-gradient-to: rgb(115 115 115 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); } +.from-slate-600 { + --tw-gradient-from: #475569 var(--tw-gradient-from-position); + --tw-gradient-to: rgb(71 85 105 / 0) var(--tw-gradient-to-position); + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + .from-transparent { --tw-gradient-from: transparent var(--tw-gradient-from-position); --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position); @@ -641,14 +641,14 @@ video { --tw-gradient-stops: var(--tw-gradient-from), #60a5fa var(--tw-gradient-via-position), var(--tw-gradient-to); } -.to-rose-500 { - --tw-gradient-to: #f43f5e var(--tw-gradient-to-position); -} - .to-neutral-500 { --tw-gradient-to: #737373 var(--tw-gradient-to-position); } +.to-rose-500 { + --tw-gradient-to: #f43f5e var(--tw-gradient-to-position); +} + .to-transparent { --tw-gradient-to: transparent var(--tw-gradient-to-position); } diff --git a/template/templates/login.tmpl b/template/templates/login.tmpl index 5b95fcc..20fd55a 100644 --- a/template/templates/login.tmpl +++ b/template/templates/login.tmpl @@ -4,11 +4,6 @@ rounded-md drop-shadow-md bg-slate-50 hover:bg-slate-200 transition-colors" href="/auth/login"> - Liljamo Auth + {{ .oidcloginvisual }} -
-
-
OR
-
-
{{ end }} -- 2.44.1