diff --git a/index.js b/index.js index eb3e23e..67cadb3 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ authoriseButton.addEventListener('click', redirect); window.onload = () => { - if (location.protocol !== 'https:') { + if (location.protocol !== 'https:' && !(location.hostname === 'localhost' || location.hostname === '127.0.0.1')) { location.replace(`https:${location.href.substring(location.protocol.length)}`); diff --git a/js/pkce.js b/js/pkce.js index 1b78936..e5d87f5 100644 --- a/js/pkce.js +++ b/js/pkce.js @@ -45,7 +45,7 @@ function generateRandomString (length) { async function redirect () { - if (location.protocol !== 'https:') { + if (location.protocol !== 'https:' && !(location.hostname === 'localhost' || location.hostname === '127.0.0.1')) { console.error('App only runs on HTTPS');