diff --git a/auth.go b/auth.go index 03345c3..ddd0f4d 100644 --- a/auth.go +++ b/auth.go @@ -82,7 +82,7 @@ func completeAuth(w http.ResponseWriter, username string, email string, firstnam Expires: time.Now().Add(30 * 24 * time.Hour), HttpOnly: true, SameSite: http.SameSiteStrictMode, - Secure: true, + //Secure: true, }) return diff --git a/auth_krb5.go b/auth_krb5.go index ff6d1ed..012f09b 100644 --- a/auth_krb5.go +++ b/auth_krb5.go @@ -51,7 +51,7 @@ func checkAuthKrb5(w http.ResponseWriter, _ httprouter.Params, body []byte) (int } } - if !userExists(lf.Login) && !found { + if !found { return nil, fmt.Errorf("You are not allowed to log you in this way. Please use OpenID Connect.") } diff --git a/auth_oidc.go b/auth_oidc.go index e5ca93b..828153b 100644 --- a/auth_oidc.go +++ b/auth_oidc.go @@ -20,7 +20,6 @@ var ( oidcRedirectURL = "https://srs.nemunai.re" oauth2Config oauth2.Config oidcVerifier *oidc.IDTokenVerifier - nextSessionMap = map[string]string{} ) func init() { @@ -61,12 +60,6 @@ func initializeOIDC() { func redirectOIDC_CRI(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { session, err := NewSession() - - // Save next parameter - if len(r.URL.Query().Get("next")) > 0 { - nextSessionMap[fmt.Sprintf("%x", session.Id)] = r.URL.Query().Get("next") - } - if err != nil { http.Error(w, fmt.Sprintf("{'errmsg':%q}", err.Error()), http.StatusInternalServerError) } else { @@ -128,12 +121,5 @@ func OIDC_CRI_complete(w http.ResponseWriter, r *http.Request, ps httprouter.Par return } - // Retrieve next URL associated with session - if next, ok := nextSessionMap[fmt.Sprintf("%x", session.Id)]; ok { - http.Redirect(w, r, next, http.StatusFound) - delete(nextSessionMap, fmt.Sprintf("%x", session.Id)) - } else { - http.Redirect(w, r, "/", http.StatusFound) - } - + http.Redirect(w, r, "/", http.StatusFound) } diff --git a/ui/src/components/AuthButton.svelte b/ui/src/components/AuthButton.svelte deleted file mode 100644 index fc148fe..0000000 --- a/ui/src/components/AuthButton.svelte +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/ui/src/routes/__layout.svelte b/ui/src/routes/__layout.svelte index a99d9f2..10145b6 100644 --- a/ui/src/routes/__layout.svelte +++ b/ui/src/routes/__layout.svelte @@ -42,7 +42,6 @@