From 60ce40e404a42e6e0a437f4d65c0b7b440c6c2ee Mon Sep 17 00:00:00 2001 From: Kim Tore Jensen Date: Thu, 19 Aug 2021 11:39:16 +0200 Subject: [PATCH] fixes and formatting --- pkg/config/config.go | 30 +++++++++++++++--------------- pkg/router/router.go | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index cbce72b..e598458 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -15,24 +15,24 @@ type Config struct { } type IDPorten struct { - ClientID string `json:"client-id"` - ClientJWK string `json:"client-jwk"` - RedirectURI string `json:"redirect-uri"` - WellKnownURL string `json:"well-known-url"` - WellKnown IDPortenWellKnown `json:"well-known"` - Locale string `json:"locale"` - SecurityLevel string `json:"security-level"` + ClientID string `json:"client-id"` + ClientJWK string `json:"client-jwk"` + RedirectURI string `json:"redirect-uri"` + WellKnownURL string `json:"well-known-url"` + WellKnown IDPortenWellKnown `json:"well-known"` + Locale string `json:"locale"` + SecurityLevel string `json:"security-level"` } const ( - BindAddress = "bind-address" - LogFormat = "log-format" - LogLevel = "log-level" - IDPortenClientID = "idporten.client-id" - IDPortenClientJWK = "idporten.client-jwk" - IDPortenRedirectURI = "idporten.redirect-uri" - IDPortenWellKnownURL = "idporten.well-known-url" - IDPortenLocale = "idporten.locale" + BindAddress = "bind-address" + LogFormat = "log-format" + LogLevel = "log-level" + IDPortenClientID = "idporten.client-id" + IDPortenClientJWK = "idporten.client-jwk" + IDPortenRedirectURI = "idporten.redirect-uri" + IDPortenWellKnownURL = "idporten.well-known-url" + IDPortenLocale = "idporten.locale" IDPortenSecurityLevel = "idporten.security-level" ) diff --git a/pkg/router/router.go b/pkg/router/router.go index eebf8c2..c65812f 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -38,6 +38,7 @@ func (h *Handler) Login(w http.ResponseWriter, r *http.Request) { randomUUID2, err := uuid.NewRandom() if err != nil { http.Error(w, "failed to create nonce: "+err.Error(), http.StatusUnauthorized) + return } nonce := randomUUID2.String()