Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solana user profile support #1193

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading