convert auth helpers to modules
This commit is contained in:
parent
3f5f10d861
commit
56a5f16e5a
4 changed files with 66 additions and 67 deletions
|
|
@ -481,8 +481,8 @@
|
|||
<script type="module" src="/js/voicePreferences.js"></script>
|
||||
<script defer src="/js/app.js?v=7.1.3"></script>
|
||||
<script type="module" src="/js/ui-state.js"></script>
|
||||
<script defer src="/js/secureStorage.js"></script>
|
||||
<script defer src="/js/authFetch.js"></script>
|
||||
<script type="module" src="/js/secureStorage.js"></script>
|
||||
<script type="module" src="/js/authFetch.js"></script>
|
||||
<script defer src="/js/auth.js"></script>
|
||||
<script defer src="/js/liveEncounter.js"></script>
|
||||
<script defer src="/js/voiceDictation.js"></script>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@
|
|||
// the login screen.
|
||||
// ============================================================
|
||||
|
||||
(function() {
|
||||
if (window.__fetchAuthIntercepted) return;
|
||||
if (!window.__fetchAuthIntercepted) {
|
||||
window.__fetchAuthIntercepted = true;
|
||||
|
||||
var _fetch = window.fetch.bind(window);
|
||||
|
|
@ -96,4 +95,4 @@
|
|||
return resp;
|
||||
});
|
||||
};
|
||||
})();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,23 +4,22 @@
|
|||
// Capacitor mobile: iOS Keychain / Android EncryptedSharedPreferences
|
||||
// via capacitor-secure-storage-plugin
|
||||
// ============================================================
|
||||
(function() {
|
||||
var memCache = {};
|
||||
var memCache = {};
|
||||
|
||||
function isNative() {
|
||||
function isNative() {
|
||||
try {
|
||||
return !!(window.Capacitor && typeof window.Capacitor.isNativePlatform === 'function' && window.Capacitor.isNativePlatform());
|
||||
} catch(e) { return false; }
|
||||
}
|
||||
}
|
||||
|
||||
function plugin() {
|
||||
function plugin() {
|
||||
try {
|
||||
var p = window.Capacitor && window.Capacitor.Plugins && window.Capacitor.Plugins.SecureStoragePlugin;
|
||||
return p || null;
|
||||
} catch(e) { return null; }
|
||||
}
|
||||
}
|
||||
|
||||
window.SecureStorage = {
|
||||
window.SecureStorage = {
|
||||
isNative: isNative,
|
||||
|
||||
get: function(key) {
|
||||
|
|
@ -69,5 +68,4 @@
|
|||
.catch(function() { memCache[k] = null; });
|
||||
}));
|
||||
}
|
||||
};
|
||||
})();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ const moduleEntrypoints = [
|
|||
'public/js/clinicalAssistant.js',
|
||||
'public/js/admin.js',
|
||||
'public/js/admin-docs.js',
|
||||
'public/js/authFetch.js',
|
||||
'public/js/diagrams.js',
|
||||
'public/js/drugs-loader.js',
|
||||
'public/js/ed-encounters.js',
|
||||
|
|
@ -20,6 +21,7 @@ const moduleEntrypoints = [
|
|||
'public/js/notes.js',
|
||||
'public/js/sickVisit.js',
|
||||
'public/js/soap.js',
|
||||
'public/js/secureStorage.js',
|
||||
'public/js/transcriptionSettings.js',
|
||||
'public/js/ui-state.js',
|
||||
'public/js/wellVisit.js',
|
||||
|
|
|
|||
Loading…
Reference in a new issue