浏览代码

set token on new client for api post

pull/36/head
Rob Loranger 4 年前
父节点
当前提交
86e9757c4b
找不到此签名对应的密钥 GPG 密钥 ID: D6F1633A4F0903B8
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      api/api.go

+ 7
- 0
api/api.go 查看文件

@@ -105,6 +105,13 @@ func DoPost(c *cli.Context, post []byte, font string, encrypt, code bool) (*writ
return nil, fmt.Errorf("%v", err)
}

u, _ := config.LoadUser(c)
if u != nil && c.App.Name == "wf" {
cl.SetToken(u.AccessToken)
} else {
return nil, fmt.Errorf("Not currently logged in. Authenticate with: " + executable.Name() + " auth <username>")
}

pp := &writeas.PostParams{
Font: config.GetFont(code, font),
Collection: config.Collection(c),


正在加载...
取消
保存