Skip to content

Commit

Permalink
fix(touchid): use serial auth
Browse files Browse the repository at this point in the history
use serial auth

Signed-off-by: mritd <[email protected]>
  • Loading branch information
mritd committed Sep 14, 2020
1 parent 6e7ef7d commit a1d6b3a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/mritd/promptx v0.0.0-20200515061936-66e281bd3c15
github.com/mritd/touchid v0.0.0-20200824100350-2d13cbf3e45d
github.com/mritd/touchid v0.0.0-20200914041600-145dfa05fb2b
github.com/pkg/sftp v1.11.0
github.com/spf13/cobra v1.0.0
github.com/xyproto/clip v0.3.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ github.com/mritd/promptx v0.0.0-20200515061936-66e281bd3c15 h1:WFAv83HnY9yHpQWeD
github.com/mritd/promptx v0.0.0-20200515061936-66e281bd3c15/go.mod h1:3fywjHX11nsf0f4lrmJ5zuwdxTEn6qh5v3LV2Nt8nVc=
github.com/mritd/readline v0.0.0-20190919142632-e26f42a56c34 h1:BPeB6AxncRXhTouiFcv++Gso1IOki6rCVhkEE36DI6I=
github.com/mritd/readline v0.0.0-20190919142632-e26f42a56c34/go.mod h1:RCmOeHfgzDd3ofo+QDJZ4tjCOv3SWN8WPk3piOfjqiU=
github.com/mritd/touchid v0.0.0-20200824100350-2d13cbf3e45d h1:jwBxaWFtVdOPw/bmu6laYQ2zEDgsbWV5EEoFYC85B58=
github.com/mritd/touchid v0.0.0-20200824100350-2d13cbf3e45d/go.mod h1:Y4q67wYoVNg3k3jXwY8lB4a7idPYhQcA23ZOBIE/TgY=
github.com/mritd/touchid v0.0.0-20200914041600-145dfa05fb2b h1:FcJ4BM8NOoPP4jJ3V7YSe91nrcxC3H2NcIzZczqr8fw=
github.com/mritd/touchid v0.0.0-20200914041600-145dfa05fb2b/go.mod h1:Y4q67wYoVNg3k3jXwY8lB4a7idPYhQcA23ZOBIE/TgY=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
Expand Down
5 changes: 4 additions & 1 deletion pkg/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ func (s *Server) wrapperClient(secondLast bool) (*ssh.Client, error) {
if s.ExtAuth == "true" {
s.ExtAuth = "any"
}
ok, err := touchid.Auth(touchid.DeviceType(s.ExtAuth), fmt.Sprintf(" login server => %s\n\nUser: %s\nAddr: %s:%d", s.Name, s.User, s.Address, s.Port))
ok, err := touchid.SerialAuth(
touchid.DeviceType(s.ExtAuth),
fmt.Sprintf(" login server => %s\n\nUser: %s\nAddr: %s:%d", s.Name, s.User, s.Address, s.Port),
5*time.Second)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit a1d6b3a

Please sign in to comment.