diff --git a/package-lock.json b/package-lock.json index 31d4ba5..ff799d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openfort/openfort-js", - "version": "0.6.8", + "version": "0.6.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openfort/openfort-js", - "version": "0.6.8", + "version": "0.6.9", "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.7.0", diff --git a/package.json b/package.json index 16e5a84..05905f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openfort/openfort-js", - "version": "0.6.8", + "version": "0.6.9", "description": "", "author": "Openfort", "repository": { diff --git a/src/clients/iframe-client.ts b/src/clients/iframe-client.ts index 5e29f0b..9e26bee 100644 --- a/src/clients/iframe-client.ts +++ b/src/clients/iframe-client.ts @@ -8,6 +8,7 @@ import { IEventResponse, LogoutRequest, LogoutResponse, + OpenfortConfiguration, ShieldAuthentication, SignRequest, SignResponse, @@ -152,9 +153,16 @@ export class IframeClient { async sign(message: string, requireArrayify?: boolean, requireHash?: boolean): Promise { await this.waitForIframeLoad(); const uuid = this.generateShortUUID(); - const request = new SignRequest(uuid, message, requireArrayify, requireHash); + const openfortConfiguration: OpenfortConfiguration = { + openfortURL: this._configuration.openfortURL, + publishableKey: this._configuration.publishableKey, + thirdPartyProvider: this._configuration.thirdPartyProvider, + thirdPartyTokenType: this._configuration.thirdPartyTokenType, + token: this._configuration.accessToken, + }; + const request = new SignRequest(uuid, message, requireArrayify, requireHash, openfortConfiguration); this._iframe.contentWindow?.postMessage(request, "*"); - + let response: SignResponse; try { response = await this.waitForResponse(uuid); diff --git a/src/clients/types.ts b/src/clients/types.ts index fb48fa2..82c6782 100644 --- a/src/clients/types.ts +++ b/src/clients/types.ts @@ -102,15 +102,16 @@ export class SignRequest implements IEventRequest { message: string; requireArrayify?: boolean; requireHash?: boolean; + openfortConfiguration?: OpenfortConfiguration; - constructor(uuid: string, message: string, requireArrayify?: boolean, requireHash?: boolean) { + constructor(uuid: string, message: string, requireArrayify?:boolean, requireHash?:boolean, openfortConfiguration?: OpenfortConfiguration) { this.uuid = uuid; this.message = message; this.requireArrayify = requireArrayify; this.requireHash = requireHash; + this.openfortConfiguration = openfortConfiguration; } } - export interface IEventResponse extends IEvent { success: boolean; action: Event; @@ -218,3 +219,11 @@ export enum AuthType { OPENFORT = "openfort", CUSTOM = "custom", } + +export interface OpenfortConfiguration { + token: string; + thirdPartyProvider?: string; + thirdPartyTokenType?: string; + publishableKey: string; + openfortURL?: string; +} \ No newline at end of file diff --git a/src/version.ts b/src/version.ts index fd625ef..d68933d 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,2 +1,2 @@ -export const VERSION = "0.6.8"; +export const VERSION = "0.6.9"; export const PACKAGE = "@openfort/openfort-js";