Skip to content

Commit

Permalink
Merge pull request #48 from openfort-xyz/fix/player-authentication
Browse files Browse the repository at this point in the history
fix: pass player on configure event
  • Loading branch information
gllm-dev authored Jul 19, 2024
2 parents b6ce7aa + a0789c2 commit 77a0e9f
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.7.24] - 2024-07-19
### Added
- Pass player id through configure request

## [0.7.23] - 2024-07-19
### Fixed
- Rollback to previous version
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/auth-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@heroicons/react": "^2.0.13",
"@openfort/openfort-js": "0.7.23",
"@openfort/openfort-js": "0.7.24",
"@openfort/openfort-node": "^0.6.62",
"@radix-ui/react-toast": "^1.1.2",
"@rainbow-me/rainbowkit": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@openfort/platform-bridge",
"version": "0.0.0",
"dependencies": {
"@openfort/openfort-js": "0.7.23",
"@openfort/openfort-js": "0.7.24",
"ethers": "^5.7.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfort/openfort-js",
"version": "0.7.23",
"version": "0.7.24",
"author": "Openfort (https://www.openfort.xyz)",
"bugs": "https://github.com/openfort-xyz/openfort-js/issues",
"repository": "openfort-xyz/openfort-js.git",
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/iframe/iframeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface IframeConfiguration {
thirdPartyTokenType: string | null;
thirdPartyProvider: string | null;
accessToken: string | null;
playerID: string | null;
recovery: ShieldAuthentication | null;
chainId: number | null;
}
Expand Down Expand Up @@ -198,6 +199,7 @@ export default class IframeManager {
publishableKey: this.sdkConfiguration.baseConfiguration.publishableKey,
shieldAPIKey: this.sdkConfiguration.shieldConfiguration.shieldPublishableKey,
accessToken: iframeConfiguration.accessToken,
playerID: iframeConfiguration.playerID,
thirdPartyProvider: iframeConfiguration.thirdPartyProvider,
thirdPartyTokenType: iframeConfiguration.thirdPartyTokenType,
encryptionKey: password ?? null,
Expand Down
4 changes: 4 additions & 0 deletions sdk/src/iframe/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,16 @@ export class ConfigureRequest implements IEventRequest {

thirdPartyTokenType: string | null;

playerID: string | null;

constructor(
uuid: string,
chainId: number,
recovery: ShieldAuthentication,
publishableKey: string,
shieldAPIKey: string,
accessToken: string,
playerID: string,
openfortURL: string,
shieldURL: string,
encryptionKey = null,
Expand All @@ -151,6 +154,7 @@ export class ConfigureRequest implements IEventRequest {
this.publishableKey = publishableKey;
this.shieldAPIKey = shieldAPIKey;
this.accessToken = accessToken;
this.playerID = playerID;
this.thirdPartyProvider = thirdPartyProvider;
this.thirdPartyTokenType = thirdPartyTokenType;
this.encryptionKey = encryptionKey;
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/openfort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ export class Openfort {

const iframeConfiguration: IframeConfiguration = {
accessToken: this.instanceManager.getAccessToken()?.token ?? null,
playerID: this.instanceManager.getPlayerID() ?? null,
thirdPartyProvider: this.instanceManager.getAccessToken()?.thirdPartyProvider ?? null,
thirdPartyTokenType: this.instanceManager.getAccessToken()?.thirdPartyTokenType ?? null,
chainId: !chainId ? Number(this.instanceManager.getChainID()) ?? null : chainId,
Expand All @@ -851,6 +852,7 @@ export class Openfort {
case SignerType.EMBEDDED: {
const iframeConfiguration: IframeConfiguration = {
accessToken: this.instanceManager.getAccessToken()?.token ?? null,
playerID: this.instanceManager.getPlayerID() ?? null,
thirdPartyProvider: this.instanceManager.getAccessToken()?.thirdPartyProvider ?? null,
thirdPartyTokenType: this.instanceManager.getAccessToken()?.thirdPartyTokenType ?? null,
chainId: null,
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const VERSION = '0.7.23';
export const VERSION = '0.7.24';
export const PACKAGE = '@openfort/openfort-js';
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,7 @@ __metadata:
languageName: unknown
linkType: soft

"@openfort/openfort-js@0.7.23, @openfort/openfort-js@workspace:sdk":
"@openfort/openfort-js@0.7.24, @openfort/openfort-js@workspace:sdk":
version: 0.0.0-use.local
resolution: "@openfort/openfort-js@workspace:sdk"
dependencies:
Expand Down Expand Up @@ -1458,7 +1458,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@openfort/platform-bridge@workspace:packages/platform-bridge"
dependencies:
"@openfort/openfort-js": 0.7.23
"@openfort/openfort-js": 0.7.24
eslint: ^8.40.0
ethers: ^5.7.0
parcel: ^2.8.3
Expand Down

0 comments on commit 77a0e9f

Please sign in to comment.