소스 검색

fix user auth for writeas posting

pull/36/head
Rob Loranger 4 년 전
부모
커밋
96f57d52e8
No known key found for this signature in database 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


불러오는 중...
취소
저장