From f9e51e037b8ae6b8f8d5fa4945f1baddc1e472b4 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Fri, 20 Sep 2024 00:39:25 +0100 Subject: [PATCH] Fix problem with logout button The logout auth endpoint was returning no response body and type application/json which is not valid, this commit changes it to return plain/text instead which makes it valid. --- backend/go.mod | 2 +- backend/go.sum | 4 ++++ backend/vendor/github.com/go-pkgz/auth/README.md | 4 ++-- .../vendor/github.com/go-pkgz/auth/provider/apple_pubkeys.go | 2 +- backend/vendor/github.com/go-pkgz/auth/token/jwt.go | 2 +- backend/vendor/modules.txt | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/backend/go.mod b/backend/go.mod index fc9330e3b2..f79ff95f6a 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-chi/chi/v5 v5.1.0 github.com/go-chi/cors v1.2.1 github.com/go-chi/render v1.0.3 - github.com/go-pkgz/auth v1.24.0 + github.com/go-pkgz/auth v1.24.1 github.com/go-pkgz/jrpc v0.3.0 github.com/go-pkgz/lcw/v2 v2.0.0 github.com/go-pkgz/lgr v0.11.1 diff --git a/backend/go.sum b/backend/go.sum index 4425589228..115cabe8f6 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -62,6 +62,10 @@ github.com/go-oauth2/oauth2/v4 v4.5.2 h1:CuZhD3lhGuI6aNLyUbRHXsgG2RwGRBOuCBfd4WQ github.com/go-oauth2/oauth2/v4 v4.5.2/go.mod h1:wk/2uLImWIa9VVQDgxz99H2GDbhmfi/9/Xr+GvkSUSQ= github.com/go-pkgz/auth v1.24.0 h1:jo7Ke18nFGTWHdzmMKeF8zqXIC383Ptu/OXCkcQOZmI= github.com/go-pkgz/auth v1.24.0/go.mod h1:xmnzq6g8mhemW1nHnkuByXkBXsHrNf9/qkiVwJugWIs= +github.com/go-pkgz/auth v1.24.1-0.20240919232608-9e446b888187 h1:1oHLySWdk0HfDIFzXFNqA6dEK7sTgZ/7s+l/YxYql7Q= +github.com/go-pkgz/auth v1.24.1-0.20240919232608-9e446b888187/go.mod h1:xmnzq6g8mhemW1nHnkuByXkBXsHrNf9/qkiVwJugWIs= +github.com/go-pkgz/auth v1.24.1 h1:izSFGxwNEZ2MujKJWXddKc+lUW+kVP02JBXouQIW8b4= +github.com/go-pkgz/auth v1.24.1/go.mod h1:xmnzq6g8mhemW1nHnkuByXkBXsHrNf9/qkiVwJugWIs= github.com/go-pkgz/email v0.5.0 h1:fdtMDGJ8NwyBACLR0LYHaCIK/OeUwZHMhH7Q0+oty9U= github.com/go-pkgz/email v0.5.0/go.mod h1:BdxglsQnymzhfdbnncEE72a6DrucZHy6I+42LK2jLEc= github.com/go-pkgz/expirable-cache v0.1.0/go.mod h1:GTrEl0X+q0mPNqN6dtcQXksACnzCBQ5k/k1SwXJsZKs= diff --git a/backend/vendor/github.com/go-pkgz/auth/README.md b/backend/vendor/github.com/go-pkgz/auth/README.md index 9d07ff297a..2ddb757a34 100644 --- a/backend/vendor/github.com/go-pkgz/auth/README.md +++ b/backend/vendor/github.com/go-pkgz/auth/README.md @@ -532,7 +532,7 @@ Follow to next steps for configuring on the Apple side: After completing the previous steps, you can proceed with configuring the Apple auth provider. Here are the parameters for AppleConfig: -- _ClientID_ (**required**) - Service ID identifier which is used for Sign with Apple +- _ClientID_ (**required**) - Service ID (or App ID) which is used for Sign with Apple - _TeamID_ (**required**) - Identifier a developer account (use as prefix for all App ID) - _KeyID_ (**required**) - Identifier a generated key for Sign with Apple - _ResponseMode_ - Response Mode, please see [documentation](https://developer.apple.com/documentation/sign_in_with_apple/request_an_authorization_to_the_sign_in_with_apple_server?changes=_1_2#4066168) for reference, default is `form_post` @@ -541,7 +541,7 @@ After completing the previous steps, you can proceed with configuring the Apple // apple config parameters appleCfg := provider.AppleConfig{ TeamID: os.Getenv("AEXMPL_APPLE_TID"), // developer account identifier - ClientID: os.Getenv("AEXMPL_APPLE_CID"), // service identifier + ClientID: os.Getenv("AEXMPL_APPLE_CID"), // Service ID (or App ID) KeyID: os.Getenv("AEXMPL_APPLE_KEYID"), // private key identifier } ``` diff --git a/backend/vendor/github.com/go-pkgz/auth/provider/apple_pubkeys.go b/backend/vendor/github.com/go-pkgz/auth/provider/apple_pubkeys.go index ce0ccde0ea..5c3563e5b3 100644 --- a/backend/vendor/github.com/go-pkgz/auth/provider/apple_pubkeys.go +++ b/backend/vendor/github.com/go-pkgz/auth/provider/apple_pubkeys.go @@ -151,7 +151,7 @@ type appleKeySet struct { // get return Apple public key with specific KeyID (kid) func (aks *appleKeySet) get(kid string) (keys *applePublicKey, err error) { - if aks.keys == nil || len(aks.keys) == 0 { + if len(aks.keys) == 0 { return nil, fmt.Errorf("failed to get key in appleKeySet, key set is nil or empty") } diff --git a/backend/vendor/github.com/go-pkgz/auth/token/jwt.go b/backend/vendor/github.com/go-pkgz/auth/token/jwt.go index 73cc1c2c2d..56cae21975 100644 --- a/backend/vendor/github.com/go-pkgz/auth/token/jwt.go +++ b/backend/vendor/github.com/go-pkgz/auth/token/jwt.go @@ -332,7 +332,7 @@ func (j *Service) Reset(w http.ResponseWriter) { MaxAge: -1, Expires: time.Unix(0, 0), Secure: j.SecureCookies, SameSite: j.SameSite} http.SetCookie(w, &xsrfCookie) - w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.Header().Set("Content-Type", "text/plain; charset=utf-8") } // checkAuds verifies if claims.Audience in the list of allowed by audReader diff --git a/backend/vendor/modules.txt b/backend/vendor/modules.txt index 1442da22b8..f0ce286831 100644 --- a/backend/vendor/modules.txt +++ b/backend/vendor/modules.txt @@ -65,7 +65,7 @@ github.com/go-chi/render github.com/go-oauth2/oauth2/v4 github.com/go-oauth2/oauth2/v4/errors github.com/go-oauth2/oauth2/v4/server -# github.com/go-pkgz/auth v1.24.0 +# github.com/go-pkgz/auth v1.24.1 ## explicit; go 1.21 github.com/go-pkgz/auth github.com/go-pkgz/auth/avatar