Fixing DB load causing user logout. (#8559)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
80b3d14b56
Коммит
cf1688f94a
@@ -125,8 +125,10 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l4g.Info(utils.T("api.context.invalid_session.error"), err.Error())
|
l4g.Info(utils.T("api.context.invalid_session.error"), err.Error())
|
||||||
c.RemoveSessionCookie(w, r)
|
if err.StatusCode == http.StatusInternalServerError {
|
||||||
if h.requireSession {
|
c.Err = err
|
||||||
|
} else if h.requireSession {
|
||||||
|
c.RemoveSessionCookie(w, r)
|
||||||
c.Err = model.NewAppError("ServeHTTP", "api.context.session_expired.app_error", nil, "token="+token, http.StatusUnauthorized)
|
c.Err = model.NewAppError("ServeHTTP", "api.context.session_expired.app_error", nil, "token="+token, http.StatusUnauthorized)
|
||||||
}
|
}
|
||||||
} else if !session.IsOAuth && tokenLocation == app.TokenLocationQueryString {
|
} else if !session.IsOAuth && tokenLocation == app.TokenLocationQueryString {
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ func (a *App) GetSession(token string) (*model.Session, *model.AppError) {
|
|||||||
a.AddSessionToCache(session)
|
a.AddSessionToCache(session)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if sessionResult.Err.StatusCode == http.StatusInternalServerError {
|
||||||
|
return nil, sessionResult.Err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user