1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

web vault url environment for U2F

This commit is contained in:
Kyle Spearrin
2017-08-28 18:08:08 -04:00
parent ad544e5240
commit c66803ce1f
6 changed files with 35 additions and 4 deletions

View File

@@ -1,9 +1,10 @@
function U2f(successCallback, errorCallback, infoCallback) {
function U2f(webVaultUrl, successCallback, errorCallback, infoCallback) {
this.success = successCallback;
this.error = errorCallback;
this.info = infoCallback;
this.iframe = null;
this.connectorLink = document.createElement('a');
this.webVaultUrl = webVaultUrl && webVaultUrl !== '' ? webVaultUrl : 'https://vault.bitwarden.com';
}
(function () {
@@ -12,7 +13,7 @@
U2f.prototype.init = function (data) {
var self = thisU2f = this;
self.connectorLink.href = 'https://vault.bitwarden.com/u2f-connector.html' +
self.connectorLink.href = self.webVaultUrl + '/u2f-connector.html' +
'?data=' + this.base64Encode(JSON.stringify(data)) +
'&parent=' + encodeURIComponent(document.location.href) +
'&v=1';