Return unauthorized code status when not peered

This commit is contained in:
wpetit 2019-03-29 15:55:51 +01:00
parent ee4c2ad221
commit 0751c0cf7e

View File

@ -61,7 +61,7 @@ func Authenticate(store peering.Store, key *rsa.PublicKey, funcs ...OptionFunc)
clientClaims, err := assertClientToken(serverClaims.PeerID, store, clientToken)
if err != nil {
logger.Printf("[ERROR] %s", err)
if err == peering.ErrPeerNotFound {
if err == peering.ErrPeerNotFound || err == ErrNotPeered {
sendError(w, http.StatusUnauthorized)
} else {
sendError(w, http.StatusInternalServerError)