Adjust govet settings and fix issues found by it (#12947)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3a1deeaac5
Коммит
812c40a307
@@ -138,8 +138,10 @@ func (a *App) ensurePostActionCookieSecret() error {
|
||||
return err
|
||||
}
|
||||
system.Value = string(v)
|
||||
if err = a.Srv.Store.System().Save(system); err == nil {
|
||||
// If we were able to save the key, use it, otherwise ignore the error.
|
||||
// If we were able to save the key, use it, otherwise log the error.
|
||||
if appErr := a.Srv.Store.System().Save(system); appErr != nil {
|
||||
mlog.Error("Failed to save PostActionCookieSecret", mlog.Err(appErr))
|
||||
} else {
|
||||
secret = newSecret
|
||||
}
|
||||
}
|
||||
@@ -199,8 +201,10 @@ func (a *App) ensureAsymmetricSigningKey() error {
|
||||
return err
|
||||
}
|
||||
system.Value = string(v)
|
||||
if err = a.Srv.Store.System().Save(system); err == nil {
|
||||
// If we were able to save the key, use it, otherwise ignore the error.
|
||||
// If we were able to save the key, use it, otherwise log the error.
|
||||
if appErr := a.Srv.Store.System().Save(system); appErr != nil {
|
||||
mlog.Error("Failed to save AsymmetricSigningKey", mlog.Err(appErr))
|
||||
} else {
|
||||
key = newKey
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,8 +72,7 @@ func (a *App) GetSession(token string) (*model.Session, *model.AppError) {
|
||||
return nil, model.NewAppError("GetSession", "api.context.invalid_token.error", map[string]interface{}{"Token": token}, "", http.StatusUnauthorized)
|
||||
}
|
||||
|
||||
if session != nil &&
|
||||
*a.Config().ServiceSettings.SessionIdleTimeoutInMinutes > 0 &&
|
||||
if *a.Config().ServiceSettings.SessionIdleTimeoutInMinutes > 0 &&
|
||||
!session.IsOAuth &&
|
||||
session.Props[model.SESSION_PROP_TYPE] != model.SESSION_TYPE_USER_ACCESS_TOKEN {
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user