ソースを参照

fix user auth for writeas posting

pull/36/head
Rob Loranger 4年前
コミット
96f57d52e8
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: D6F1633A4F0903B8
2個のファイルの変更4行の追加1行の削除
  1. +1
    -1
      api/api.go
  2. +3
    -0
      config/user.go

+ 1
- 1
api/api.go ファイルの表示

@@ -106,7 +106,7 @@ func DoPost(c *cli.Context, post []byte, font string, encrypt, code bool) (*writ
}

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


+ 3
- 0
config/user.go ファイルの表示

@@ -136,6 +136,9 @@ func UserHostDir(c *cli.Context) (string, error) {
// CurrentUser returns the username of the user taking action in the current
// cli.Context.
func CurrentUser(c *cli.Context) (string, error) {
if c.App.Name == "writeas" {
return "user", nil
}
// Use user flag value
if c.GlobalString("user") != "" {
return c.GlobalString("user"), nil


読み込み中…
キャンセル
保存