mirror of
https://github.com/writeas/writeas-cli
synced 2025-07-26 23:08:16 +00:00
set token on new client for api post
This commit is contained in:
parent
284087a32f
commit
86e9757c4b
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user