From e0d83db609613fa82ee95259743a777de9d429a4 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Tue, 25 Feb 2020 18:54:32 +1300 Subject: [PATCH] fix(authentication/ldap): fix an issue with authorizations not updated after ldap login (#3577) --- api/http/handler/auth/authenticate.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/http/handler/auth/authenticate.go b/api/http/handler/auth/authenticate.go index 56441c33a..8e51f65db 100644 --- a/api/http/handler/auth/authenticate.go +++ b/api/http/handler/auth/authenticate.go @@ -79,6 +79,11 @@ func (handler *Handler) authenticateLDAP(w http.ResponseWriter, user *portainer. log.Printf("Warning: unable to automatically add user into teams: %s\n", err.Error()) } + err = handler.AuthorizationService.UpdateUsersAuthorizations() + if err != nil { + return &httperror.HandlerError{http.StatusInternalServerError, "Unable to update user authorizations", err} + } + return handler.writeToken(w, user) } @@ -175,6 +180,7 @@ func (handler *Handler) addUserIntoTeams(user *portainer.User, settings *portain } } } + return nil }