[MM-12958] Support running two Mattermost instances on the same domain using subpaths (#10493)
Этот коммит содержится в:
@@ -654,11 +654,13 @@ func (a *App) GetAuthorizationCode(w http.ResponseWriter, r *http.Request, servi
|
||||
}
|
||||
|
||||
cookieValue := model.NewId()
|
||||
subpath, _ := utils.GetSubpathFromConfig(a.Config())
|
||||
|
||||
expiresAt := time.Unix(model.GetMillis()/1000+int64(OAUTH_COOKIE_MAX_AGE_SECONDS), 0)
|
||||
oauthCookie := &http.Cookie{
|
||||
Name: COOKIE_OAUTH,
|
||||
Value: cookieValue,
|
||||
Path: "/",
|
||||
Path: subpath,
|
||||
MaxAge: OAUTH_COOKIE_MAX_AGE_SECONDS,
|
||||
Expires: expiresAt,
|
||||
HttpOnly: true,
|
||||
@@ -741,10 +743,12 @@ func (a *App) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service
|
||||
mlog.Error(appErr.Error())
|
||||
}
|
||||
|
||||
subpath, _ := utils.GetSubpathFromConfig(a.Config())
|
||||
|
||||
httpCookie := &http.Cookie{
|
||||
Name: COOKIE_OAUTH,
|
||||
Value: "",
|
||||
Path: "/",
|
||||
Path: subpath,
|
||||
MaxAge: -1,
|
||||
HttpOnly: true,
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user