changeset 261:ab9859981ee3

If a user got renamed kick her/him from the connection pool.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 27 Jul 2018 14:55:47 +0200
parents c2cef3ce8853
children 92470caf81fd
files controllers/user.go
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/controllers/user.go	Fri Jul 27 13:25:14 2018 +0200
+++ b/controllers/user.go	Fri Jul 27 14:55:47 2018 +0200
@@ -251,6 +251,11 @@
 		return
 	}
 
+	if user != newUser.User {
+		// Running in a go routine should not be necessary.
+		go func() { auth.ConnPool.Logout(user) }()
+	}
+
 	jr = JSONResult{
 		Code: http.StatusCreated,
 		Result: struct {