From ab0dc8cfd12ad1808ca7b83660586b61db53aade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez?= Date: Thu, 26 Sep 2019 12:07:22 +0200 Subject: [PATCH] M #-: Fix GOCA bug (#3776) --- src/oca/go/src/goca/user.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/oca/go/src/goca/user.go b/src/oca/go/src/goca/user.go index 56c296ed63..1bef6c1948 100644 --- a/src/oca/go/src/goca/user.go +++ b/src/oca/go/src/goca/user.go @@ -131,7 +131,12 @@ func (uc *UserController) Passwd(password string) error { // * timeSeconds: Valid period in seconds; 0 reset the token and -1 for a non-expiring token. // * effectiveGID: Effective GID to use with this token. To use the current GID and user groups set it to -1 func (uc *UserController) Login(token string, timeSeconds int, effectiveGID int) error { - _, err := uc.c.Client.Call("one.user.login", uc.Name, token, timeSeconds, effectiveGID) + user, err := uc.Info() + + if err != nil { + return err + } + _, err = uc.c.Client.Call("one.user.login", user.Name, token, timeSeconds, effectiveGID) return err }