Don't try to use webcrypto if not https

This commit is contained in:
pehmo1 2021-08-19 23:39:46 +03:00
parent b40bd2ed25
commit c5a452933a
1 changed files with 5 additions and 5 deletions

View File

@ -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,