From 2a10410cdc0aed946d06cdaad1f90373c86ba8f2 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 31 Oct 2023 16:02:53 -0700 Subject: [PATCH 1/3] added build5 token --- src/app/components/auth/services/auth.service.ts | 10 +++++++--- src/environments/environment.prod.ts | 1 + src/environments/environment.ts | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/components/auth/services/auth.service.ts b/src/app/components/auth/services/auth.service.ts index c1e950b..9b99cc5 100644 --- a/src/app/components/auth/services/auth.service.ts +++ b/src/app/components/auth/services/auth.service.ts @@ -25,6 +25,7 @@ import { NzNotificationService } from 'ng-zorro-antd/notification'; import { BehaviorSubject, firstValueFrom, skip, Subscription } from 'rxjs'; import { MemberApi, TokenDistributionWithAirdrops } from './../../../@api/member.api'; import { removeItem } from './../../../@core/utils/local-storage.utils'; +import { environment } from '@env/environment'; const tanglePay = (window as any).iota; export interface MetamaskSignature { @@ -206,7 +207,7 @@ export class AuthService { public async sign(params: any = {}, cb: SignCallback): Promise { this.showWalletPopup$.next(WalletStatus.ACTIVE); // We support either resign with metamask or reuse token. - let sc: WenRequest | undefined | false = undefined; + let sc: any | undefined | false = undefined; const customToken: any = getItem(StorageItem.CustomToken); const wallet = customToken.wallet || Wallets.Metamask; // check it's not expired. @@ -214,6 +215,7 @@ export class AuthService { sc = { address: customToken.address, customToken: customToken.value, + projectApiKey: environment.build5Token, body: params, }; } else if (customToken) { @@ -271,7 +273,7 @@ export class AuthService { return true; } - private async signWithMetamask(params: any = {}): Promise { + private async signWithMetamask(params: any = {}): Promise { const provider: any = await detectEthereumProvider(); if (provider) { try { @@ -319,6 +321,7 @@ export class AuthService { return { address: provider.selectedAddress, signature: signature, + projectApiKey: environment.build5Token, body: params, }; } catch (e) { @@ -389,9 +392,10 @@ export class AuthService { }, }); - const returnObj: WenRequest = { + const returnObj: any = { address: currentAddress, signature: signature, + projectApiKey: environment.build5Token, body: params, }; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index de026de..2627f8f 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -5,4 +5,5 @@ export const environment = { key: 'ed51a01fc204688339e89ac8e9d53028', }, soonaversePlaceholder: 'https://soonaverse.com/favicon.ico', + build5Token: '' }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 5a30516..1072c05 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,4 +5,5 @@ export const environment = { key: '5c053a0370395f0fe8cf7ce9e5a21a72', }, soonaversePlaceholder: 'https://soonaverse.com/favicon.ico', + build5Token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9' }; From a9b9608c4659b3a8c51fbe9440636284345e72ff Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 1 Nov 2023 09:45:14 -0700 Subject: [PATCH 2/3] fixed token --- src/environments/environment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 1072c05..218a7bb 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,5 +5,5 @@ export const environment = { key: '5c053a0370395f0fe8cf7ce9e5a21a72', }, soonaversePlaceholder: 'https://soonaverse.com/favicon.ico', - build5Token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9' + build5Token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIweDU1MWZkMmM3YzdiZjM1NmJhYzE5NDU4N2RhYjJmY2Q0NjQyMDA1NGIiLCJwcm9qZWN0IjoiMHg0NjIyM2VkZDQxNTc2MzVkZmM2Mzk5MTU1NjA5ZjMwMWRlY2JmZDg4IiwiaWF0IjoxNjk1ODUyNTk2fQ.WT9L4H9eDdFfJZMrfxTKhEq4PojNWSGNv_CbmlG9sJg' }; From fcc77c46ddbe184991e7cd2ea68fc35d15bf0693 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 1 Nov 2023 09:49:04 -0700 Subject: [PATCH 3/3] run prettier --- src/environments/environment.prod.ts | 2 +- src/environments/environment.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 2627f8f..1a80548 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -5,5 +5,5 @@ export const environment = { key: 'ed51a01fc204688339e89ac8e9d53028', }, soonaversePlaceholder: 'https://soonaverse.com/favicon.ico', - build5Token: '' + build5Token: '', }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 218a7bb..04785f6 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,5 +5,6 @@ export const environment = { key: '5c053a0370395f0fe8cf7ce9e5a21a72', }, soonaversePlaceholder: 'https://soonaverse.com/favicon.ico', - build5Token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIweDU1MWZkMmM3YzdiZjM1NmJhYzE5NDU4N2RhYjJmY2Q0NjQyMDA1NGIiLCJwcm9qZWN0IjoiMHg0NjIyM2VkZDQxNTc2MzVkZmM2Mzk5MTU1NjA5ZjMwMWRlY2JmZDg4IiwiaWF0IjoxNjk1ODUyNTk2fQ.WT9L4H9eDdFfJZMrfxTKhEq4PojNWSGNv_CbmlG9sJg' + build5Token: + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIweDU1MWZkMmM3YzdiZjM1NmJhYzE5NDU4N2RhYjJmY2Q0NjQyMDA1NGIiLCJwcm9qZWN0IjoiMHg0NjIyM2VkZDQxNTc2MzVkZmM2Mzk5MTU1NjA5ZjMwMWRlY2JmZDg4IiwiaWF0IjoxNjk1ODUyNTk2fQ.WT9L4H9eDdFfJZMrfxTKhEq4PojNWSGNv_CbmlG9sJg', };