mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
REST API/Web admin: add a parameter to disconnect a user after an update
This way you can force the user to login again and so to use the updated configuration. A deleted user will be automatically disconnected. Fixes #163 Improved some docs too.
This commit is contained in:
@@ -687,7 +687,7 @@ func TestBasicUsersCache(t *testing.T) {
|
||||
assert.False(t, cachedUser.IsExpired())
|
||||
}
|
||||
// cache is invalidated after a user modification
|
||||
user, _, err = httpd.UpdateUser(user, http.StatusOK)
|
||||
user, _, err = httpd.UpdateUser(user, http.StatusOK, "")
|
||||
assert.NoError(t, err)
|
||||
_, ok = dataprovider.GetCachedWebDAVUser(username)
|
||||
assert.False(t, ok)
|
||||
@@ -836,7 +836,7 @@ func TestUsersCacheSizeAndExpiration(t *testing.T) {
|
||||
assert.True(t, ok)
|
||||
|
||||
// now remove user1 after an update
|
||||
user1, _, err = httpd.UpdateUser(user1, http.StatusOK)
|
||||
user1, _, err = httpd.UpdateUser(user1, http.StatusOK, "")
|
||||
assert.NoError(t, err)
|
||||
_, ok = dataprovider.GetCachedWebDAVUser(user1.Username)
|
||||
assert.False(t, ok)
|
||||
|
||||
Reference in New Issue
Block a user