diff --git a/lib/cartodb/signed_maps.js b/lib/cartodb/signed_maps.js index 4a62432f..6c4af8d3 100644 --- a/lib/cartodb/signed_maps.js +++ b/lib/cartodb/signed_maps.js @@ -94,6 +94,14 @@ o.authorizedByCert = function(cert, auth) { throw new Error("Unsupported certificate version " + cert.version); } + if ( ! cert.auth ) { + throw new Error("No certificate authorization"); + } + + if ( ! cert.auth.method ) { + throw new Error("No certificate authorization method"); + } + // Open authentication certificates are always authorized if ( cert.auth.method === 'open' ) return true;