func (c *logoutCmd) AfterApply() error {
	conf, _, err := config.Extract()
	if err != nil {
		return err
	}
	var profile config.Profile
	if c.Profile == "" {
		_, profile, err = conf.GetDefaultUpboundProfile()
		if err != nil {
			return err
		}
	} else {
		profile, err = conf.GetUpboundProfile(c.Profile)
		if err != nil {
			return err
		}
	}
	cfg, err := upbound.BuildSDKConfig(profile.Session, c.Endpoint)
	if err != nil {
		return err
	}
	c.client = cfg.Client
	return nil
}
AfterApply sets default values in login after assignment and validation.
package main
import (
	"context"
	"net/http"
	"net/url"
	"github.com/pkg/errors"
	"github.com/upbound/up-sdk-go"
	"github.com/upbound/up/internal/config"
	"github.com/upbound/up/internal/upbound"
)
const (
	logoutPath = "/v1/logout"
	errLogoutFailed = "unable to logout"
)