[client] Fix error handling for set config request on CLI (#4237)

[client] Fix error handling for set config request on CLI (#4237)
This commit is contained in:
hakansa
2025-07-29 20:38:44 +03:00
committed by GitHub
parent 980a6eca8e
commit a72ef1af39
2 changed files with 11 additions and 1 deletions

View File

@ -452,6 +452,11 @@ func (s *Server) Login(callerCtx context.Context, msg *proto.LoginRequest) (*pro
}
if *msg.ProfileName != activeProf.Name && username != activeProf.Username {
if s.checkProfilesDisabled() {
log.Errorf("profiles are disabled, you cannot use this feature without profiles enabled")
return nil, gstatus.Errorf(codes.Unavailable, errProfilesDisabled)
}
log.Infof("switching to profile %s for user '%s'", *msg.ProfileName, username)
if err := s.profileManager.SetActiveProfileState(&profilemanager.ActiveProfileState{
Name: *msg.ProfileName,