edge detect wip
This commit is contained in:
@@ -2,11 +2,17 @@
|
|||||||
|
|
||||||
var Neeto = Neeto || {};
|
var Neeto = Neeto || {};
|
||||||
|
|
||||||
if(window.crypto && window.crypto.subtle) {
|
// detect IE8 and above, and edge.
|
||||||
|
// IE and Edge do not support pbkdf2 in WebCrypto, therefore we need to use CryptoJS
|
||||||
|
var IEOrEdge = document.documentMode || /Edge/.test(navigator.userAgent);
|
||||||
|
|
||||||
|
if(!IEOrEdge && (window.crypto && window.crypto.subtle)) {
|
||||||
|
console.log("Using webcrypto");
|
||||||
Neeto.crypto = new SNCryptoWeb();
|
Neeto.crypto = new SNCryptoWeb();
|
||||||
} else {
|
} else {
|
||||||
Neeto.crypto = new SNCryptoJS();
|
console.log("Using CryptoJS");
|
||||||
}
|
}
|
||||||
|
Neeto.crypto = new SNCryptoJS();
|
||||||
|
|
||||||
angular.module('app.frontend', [
|
angular.module('app.frontend', [
|
||||||
'ui.router',
|
'ui.router',
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ angular.module('app.frontend')
|
|||||||
// if user has high password cost and is using browser that doesn't support WebCrypto,
|
// if user has high password cost and is using browser that doesn't support WebCrypto,
|
||||||
// we want to tell them that they can't login with this browser.
|
// we want to tell them that they can't login with this browser.
|
||||||
if(cost > 5000) {
|
if(cost > 5000) {
|
||||||
return (window.crypto && window.crypto.subtle) ? true : false;
|
return Neeto.crypto instanceof SNCryptoWeb ? true : false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user