github.com/section/sectionctl@v1.12.3/commands/logout.go (about)

     1  package commands
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/section/sectionctl/api"
     7  	"github.com/section/sectionctl/credentials"
     8  )
     9  
    10  // LogoutCmd handles revoking previously set up authentication
    11  type LogoutCmd struct{}
    12  
    13  // Run executes the command
    14  func (c *LogoutCmd) Run(logWriters *LogWriters) (err error) {
    15  	s := NewSpinner(fmt.Sprintf("Revoking your authentication for %s", api.PrefixURI.Host), logWriters)
    16  	s.Start()
    17  	err = credentials.Delete(api.PrefixURI.Host)
    18  	s.Stop()
    19  	return err
    20  }