Skip to content

Commit

Permalink
feat(auth): Failback to "none" auth if "basic" auth fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanilves committed Aug 6, 2018
1 parent d49c45f commit bbb6181
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tag/remote/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ func NewToken(repo *repository.Repository, username, password string) (TokenResp
case "None":
return none.RequestToken()
case "Basic":
return basic.RequestToken(url, username, password)
t, err := basic.RequestToken(url, username, password)
if err != nil {
println(err.Error())

return none.RequestToken()
}

return t, nil
case "Bearer":
return bearer.RequestToken(params["realm"], params["service"], repo.Path(), username, password)
default:
Expand Down

0 comments on commit bbb6181

Please sign in to comment.