Deactivating and invalidating sessions of guest users on guest disable (#13007)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
mattermod
родитель
6a75d2fc68
Коммит
7031f51b41
@@ -261,6 +261,21 @@ func NewServer(options ...Option) (*Server, error) {
|
||||
s.StartElasticsearch()
|
||||
}
|
||||
|
||||
s.AddConfigListener(func(oldConfig *model.Config, newConfig *model.Config) {
|
||||
if *oldConfig.GuestAccountsSettings.Enable && !*newConfig.GuestAccountsSettings.Enable {
|
||||
if appErr := s.FakeApp().DeactivateGuests(); appErr != nil {
|
||||
mlog.Error("Unable to deactivate guest accounts", mlog.Err(appErr))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Disable active guest accounts on first run if guest accounts are disabled
|
||||
if !*s.Config().GuestAccountsSettings.Enable {
|
||||
if appErr := s.FakeApp().DeactivateGuests(); appErr != nil {
|
||||
mlog.Error("Unable to deactivate guest accounts", mlog.Err(appErr))
|
||||
}
|
||||
}
|
||||
|
||||
s.initJobs()
|
||||
|
||||
if s.runjobs {
|
||||
|
||||
Ссылка в новой задаче
Block a user