bitski-provider
Advanced tools
Comparing version 3.5.0 to 3.5.1
# bitski-provider | ||
## 3.5.1 | ||
### Patch Changes | ||
- [#472](https://github.com/BitskiCo/bitski-js/pull/472) [`aca0a6f6cc731a832cba5891f223d61ab5c5c0c2`](https://github.com/BitskiCo/bitski-js/commit/aca0a6f6cc731a832cba5891f223d61ab5c5c0c2) Thanks [@pzuraq](https://github.com/pzuraq)! - Add isIframe query param to force prompt=none in iframes | ||
## 3.5.0 | ||
@@ -4,0 +10,0 @@ |
@@ -82,3 +82,3 @@ import SafeEventEmitter from '@metamask/safe-event-emitter'; | ||
} | ||
this.config = Object.assign(Object.assign({}, config), { fetch: (_b = config.fetch) !== null && _b !== void 0 ? _b : fetch, additionalHeaders: Object.assign({ 'X-API-KEY': appId, 'X-CLIENT-ID': appId, 'X-CLIENT-VERSION': "bitski-provider-v3.5.0" }, ((_c = config.additionalHeaders) !== null && _c !== void 0 ? _c : {})), apiBaseUrl, signerBaseUrl: (_d = config.signerBaseUrl) !== null && _d !== void 0 ? _d : BITSKI_SIGNER_BASE_URL, store: (_e = config.store) !== null && _e !== void 0 ? _e : new LocalStorageStore(), sign }); | ||
this.config = Object.assign(Object.assign({}, config), { fetch: (_b = config.fetch) !== null && _b !== void 0 ? _b : fetch, additionalHeaders: Object.assign({ 'X-API-KEY': appId, 'X-CLIENT-ID': appId, 'X-CLIENT-VERSION': "bitski-provider-v3.5.1" }, ((_c = config.additionalHeaders) !== null && _c !== void 0 ? _c : {})), apiBaseUrl, signerBaseUrl: (_d = config.signerBaseUrl) !== null && _d !== void 0 ? _d : BITSKI_SIGNER_BASE_URL, store: (_e = config.store) !== null && _e !== void 0 ? _e : new LocalStorageStore(), sign }); | ||
this.store = new BitskiProviderStateStore(this.config.store); | ||
@@ -85,0 +85,0 @@ // Setup the engine |
@@ -29,3 +29,3 @@ import { ethErrors } from 'eth-rpc-errors'; | ||
}); | ||
const url = getSignerUrl(transaction.id, context.config); | ||
const url = getSignerUrl(transaction.id, context.config, true); | ||
const iframe = document.createElement('iframe'); | ||
@@ -32,0 +32,0 @@ iframe.style.position = 'absolute'; |
@@ -1,2 +0,2 @@ | ||
export const getSignerUrl = (transactionId, config) => { | ||
export const getSignerUrl = (transactionId, config, isIframe = false) => { | ||
var _a, _b, _c, _d, _e, _f; | ||
@@ -13,4 +13,7 @@ const searchParams = (_a = config.signerQueryParams) !== null && _a !== void 0 ? _a : new URLSearchParams(); | ||
} | ||
searchParams.set('loginHint', `fa_${federatedId}`); | ||
searchParams.set('login_hint', `fa_${federatedId}`); | ||
} | ||
if (isIframe) { | ||
searchParams.set('isIframe', 'true'); | ||
} | ||
const searchParamsSerialized = searchParams.toString(); | ||
@@ -17,0 +20,0 @@ const searchParamsString = searchParamsSerialized !== '' ? `?${searchParamsSerialized}` : ''; |
@@ -88,3 +88,3 @@ "use strict"; | ||
} | ||
this.config = Object.assign(Object.assign({}, config), { fetch: (_b = config.fetch) !== null && _b !== void 0 ? _b : fetch, additionalHeaders: Object.assign({ 'X-API-KEY': appId, 'X-CLIENT-ID': appId, 'X-CLIENT-VERSION': "bitski-provider-v3.5.0" }, ((_c = config.additionalHeaders) !== null && _c !== void 0 ? _c : {})), apiBaseUrl, signerBaseUrl: (_d = config.signerBaseUrl) !== null && _d !== void 0 ? _d : constants_1.BITSKI_SIGNER_BASE_URL, store: (_e = config.store) !== null && _e !== void 0 ? _e : new store_1.LocalStorageStore(), sign }); | ||
this.config = Object.assign(Object.assign({}, config), { fetch: (_b = config.fetch) !== null && _b !== void 0 ? _b : fetch, additionalHeaders: Object.assign({ 'X-API-KEY': appId, 'X-CLIENT-ID': appId, 'X-CLIENT-VERSION': "bitski-provider-v3.5.1" }, ((_c = config.additionalHeaders) !== null && _c !== void 0 ? _c : {})), apiBaseUrl, signerBaseUrl: (_d = config.signerBaseUrl) !== null && _d !== void 0 ? _d : constants_1.BITSKI_SIGNER_BASE_URL, store: (_e = config.store) !== null && _e !== void 0 ? _e : new store_1.LocalStorageStore(), sign }); | ||
this.store = new store_1.BitskiProviderStateStore(this.config.store); | ||
@@ -91,0 +91,0 @@ // Setup the engine |
@@ -32,3 +32,3 @@ "use strict"; | ||
}); | ||
const url = (0, shared_1.getSignerUrl)(transaction.id, context.config); | ||
const url = (0, shared_1.getSignerUrl)(transaction.id, context.config, true); | ||
const iframe = document.createElement('iframe'); | ||
@@ -35,0 +35,0 @@ iframe.style.position = 'absolute'; |
import { InternalBitskiProviderConfig } from '../types'; | ||
export declare const getSignerUrl: (transactionId: string, config: InternalBitskiProviderConfig) => string; | ||
export declare const getSignerUrl: (transactionId: string, config: InternalBitskiProviderConfig, isIframe?: boolean) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getSignerUrl = void 0; | ||
const getSignerUrl = (transactionId, config) => { | ||
const getSignerUrl = (transactionId, config, isIframe = false) => { | ||
var _a, _b, _c, _d, _e, _f; | ||
@@ -16,4 +16,7 @@ const searchParams = (_a = config.signerQueryParams) !== null && _a !== void 0 ? _a : new URLSearchParams(); | ||
} | ||
searchParams.set('loginHint', `fa_${federatedId}`); | ||
searchParams.set('login_hint', `fa_${federatedId}`); | ||
} | ||
if (isIframe) { | ||
searchParams.set('isIframe', 'true'); | ||
} | ||
const searchParamsSerialized = searchParams.toString(); | ||
@@ -20,0 +23,0 @@ const searchParamsString = searchParamsSerialized !== '' ? `?${searchParamsSerialized}` : ''; |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "3.5.0", | ||
"version": "3.5.1", | ||
"scripts": { | ||
@@ -15,0 +15,0 @@ "test": "jest", |
@@ -50,3 +50,3 @@ import { ethErrors } from 'eth-rpc-errors'; | ||
const url = getSignerUrl(transaction.id, context.config); | ||
const url = getSignerUrl(transaction.id, context.config, true); | ||
@@ -53,0 +53,0 @@ const iframe = document.createElement('iframe'); |
@@ -6,2 +6,3 @@ import { InternalBitskiProviderConfig } from '../types'; | ||
config: InternalBitskiProviderConfig, | ||
isIframe = false, | ||
): string => { | ||
@@ -22,5 +23,9 @@ const searchParams = config.signerQueryParams ?? new URLSearchParams(); | ||
searchParams.set('loginHint', `fa_${federatedId}`); | ||
searchParams.set('login_hint', `fa_${federatedId}`); | ||
} | ||
if (isIframe) { | ||
searchParams.set('isIframe', 'true'); | ||
} | ||
const searchParamsSerialized = searchParams.toString(); | ||
@@ -27,0 +32,0 @@ const searchParamsString = searchParamsSerialized !== '' ? `?${searchParamsSerialized}` : ''; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
404768
8333