Invalidate cloud caches when a new license is loaded (#21579)
Automatic Merge
Этот коммит содержится в:
@@ -138,7 +138,7 @@ func (c *Context) SessionRequired() {
|
||||
}
|
||||
|
||||
func (c *Context) CloudKeyRequired() {
|
||||
if license := c.App.Channels().License(); license == nil || !*license.Features.Cloud || c.AppContext.Session().Props[model.SessionPropType] != model.SessionTypeCloudKey {
|
||||
if license := c.App.Channels().License(); license == nil || !license.IsCloud() || c.AppContext.Session().Props[model.SessionPropType] != model.SessionTypeCloudKey {
|
||||
c.Err = model.NewAppError("", "api.context.session_expired.app_error", nil, "TokenRequired", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
subpath, _ := utils.GetSubpathFromConfig(c.App.Config())
|
||||
siteURLHeader := app.GetProtocol(r) + "://" + r.Host + subpath
|
||||
if c.App.Channels().License() != nil && *c.App.Channels().License().Features.Cloud {
|
||||
if c.App.Channels().License().IsCloud() {
|
||||
siteURLHeader = *c.App.Config().ServiceSettings.SiteURL + subpath
|
||||
}
|
||||
c.SetSiteURLHeader(siteURLHeader)
|
||||
@@ -236,7 +236,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
cloudCSP := ""
|
||||
if c.App.Channels().License() != nil && *c.App.Channels().License().Features.Cloud {
|
||||
if c.App.Channels().License().IsCloud() {
|
||||
cloudCSP = " js.stripe.com/v3"
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
h.checkCSRFToken(c, r, token, tokenLocation, session)
|
||||
} else if token != "" && c.App.Channels().License() != nil && *c.App.Channels().License().Features.Cloud && tokenLocation == app.TokenLocationCloudHeader {
|
||||
} else if token != "" && c.App.Channels().License().IsCloud() && tokenLocation == app.TokenLocationCloudHeader {
|
||||
// Check to see if this provided token matches our CWS Token
|
||||
session, err := c.App.GetCloudSession(token)
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user