Skip to content

Commit

Permalink
Merge pull request #1193 from Giveth/feat/solana_support
Browse files Browse the repository at this point in the history
Solana user profile support
  • Loading branch information
aminlatifi authored Dec 11, 2023
2 parents 140ce66 + 8e5a618 commit 0415865
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ TRACE_FILE_UPLOADER_PASSWORD=hello_trace
API_GIV_PASSWORD=123
API_GIV_USERNAME=testApiGive

AUTH_MICROSERVICE_AUTHENTICATION_URL=https://serve.giveth.io/siweauthmicroservice/v1/authentication
AUTH_MICROSERVICE_AUTHORIZATION_URL=https://serve.giveth.io/siweauthmicroservice/v1/authorization
AUTH_MICROSERVICE_NONCE_URL=https://serve.giveth.io/siweauthmicroservice/v1/nonce
AUTH_MICROSERVICE_AUTHENTICATION_URL=https://auth.serve.giveth.io/v1/authentication
AUTH_MICROSERVICE_AUTHORIZATION_URL=https://auth.serve.giveth.io/v1/authorization
AUTH_MICROSERVICE_NONCE_URL=https://auth.serve.giveth.io/v1/nonce
PRIVATE_ETHERS_TEST_KEY=8ab0e165c2ea461b01cdd49aec882d179dccdbdb5c85c3f9c94c448aa65c5ace
PUBLIC_ETHERS_TEST_KEY=0x53bFf74b9Af2E3853f758A8D2Bd61CD115d27782

Expand Down
8 changes: 6 additions & 2 deletions src/repositories/userRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SegmentAnalyticsSingleton } from '../services/segment/segmentAnalyticsS
import { Donation } from '../entities/donation';
import { Reaction } from '../entities/reaction';
import { PowerBoosting } from '../entities/powerBoosting';
import { ethers } from 'ethers';

export const findAdminUserByEmail = async (
email: string,
Expand Down Expand Up @@ -69,10 +70,13 @@ export const findAllUsers = async (params: {
};

export const createUserWithPublicAddress = async (
walletAddress: string,
_walletAddress: string,
): Promise<User> => {
const walletAddress = ethers.utils.isAddress(_walletAddress)
? _walletAddress.toLocaleLowerCase()
: _walletAddress;
const user = await User.create({
walletAddress: walletAddress.toLowerCase(),
walletAddress,
loginType: 'wallet',
segmentIdentified: true,
}).save();
Expand Down
2 changes: 1 addition & 1 deletion src/services/authorizationServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const validateAuthMicroserviceJwt = async (
},
);

const userAddress = result.data.publicAddress.toLowerCase();
const userAddress = result.data.publicAddress;
user = await findUserByWalletAddress(userAddress);

if (!user) {
Expand Down

0 comments on commit 0415865

Please sign in to comment.