From 2194fa4902e750cd90ab91af52b12a83b3540a72 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Wed, 28 Sep 2022 22:20:48 +0200 Subject: [PATCH] call admin store with a proper key Previously it was set to fixed strings, likely a test artefact. Resolves #1499. --- backend/app/cmd/server.go | 2 +- backend/app/store/service/service.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/cmd/server.go b/backend/app/cmd/server.go index c61e3e9335..c4b718a2a8 100644 --- a/backend/app/cmd/server.go +++ b/backend/app/cmd/server.go @@ -1107,7 +1107,7 @@ func (s *ServerCommand) getAuthenticator(ds *service.DataStore, avas avatar.Stor SameSiteCookie: s.parseSameSite(s.Auth.SameSite), SecureCookies: strings.HasPrefix(s.RemarkURL, "https://"), SecretReader: token.SecretFunc(func(aud string) (string, error) { // get secret per site - return admns.Key("") + return admns.Key(aud) }), ClaimsUpd: token.ClaimsUpdFunc(func(c token.Claims) token.Claims { // set attributes, on new token or refresh if c.User == nil { diff --git a/backend/app/store/service/service.go b/backend/app/store/service/service.go index e60a77bdaf..b601cfa9b2 100644 --- a/backend/app/store/service/service.go +++ b/backend/app/store/service/service.go @@ -981,9 +981,9 @@ func (s *DataStore) prepVotes(c store.Comment, user store.User) store.Comment { } // get secret for given siteID -// Note: secret shared across sites, but some sites can be disabled. +// Note: siteID ignored for the default admin.Static store func (s *DataStore) getSecret(siteID string) (secret string, err error) { - if secret, err = s.AdminStore.Key("any"); err != nil { + if secret, err = s.AdminStore.Key(siteID); err != nil { return "", fmt.Errorf("can't get secret for site %s: %w", siteID, err) }