@@ -11,7 +11,7 @@ var logoutCmd = &cobra.Command{
|
||||
Use: "logout",
|
||||
Short: "Log out from WriteFreely, invalidating the token",
|
||||
Run: func(_ *cobra.Command, args []string) {
|
||||
DoLogout(args)
|
||||
Logout(args)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -20,7 +20,9 @@ func init() {
|
||||
rootCmd.AddCommand(logoutCmd)
|
||||
}
|
||||
|
||||
func DoLogout(args []string) {
|
||||
// Un-authenticates a user with WriteFreely, permanently
|
||||
// invalidating the access token used with the request.
|
||||
func Logout(args []string) {
|
||||
c := writefreely.NewClient(Config.Host)
|
||||
c.SetToken(Config.Token)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user