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 }