From c5a452933a47b56d13116e7272515c38b6e29bb2 Mon Sep 17 00:00:00 2001 From: pehmo1 Date: Thu, 19 Aug 2021 23:39:46 +0300 Subject: [PATCH] Don't try to use webcrypto if not https --- static/js/certidude.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/js/certidude.js b/static/js/certidude.js index d2eef0e..6a63533 100644 --- a/static/js/certidude.js +++ b/static/js/certidude.js @@ -327,14 +327,14 @@ async function onHashChanged() { } } - // Device identifier - var dig = await blobToUuid(window.navigator.userAgent); - window.common_name = prefix + "-" + dig.substring(0, 5); - console.info("Device identifier:", common_name); - if (window.location.protocol != "https:") { $("#view-dashboard").html(env.render('views/insecure.html', {authority:authority})); } else { + // Device identifier + var dig = await blobToUuid(window.navigator.userAgent); + window.common_name = prefix + "-" + dig.substring(0, 5); + console.info("Device identifier:", common_name); + if (query.action == "enroll") { $("#view-dashboard").html(env.render('views/enroll.html', { common_name: common_name,