Enhance user authentication by adding optional OwnerWalletAddress parameter in LoginRequest and UserService. Update UserController and related components to support the new wallet address functionality, ensuring better user profile management and validation in trading operations.
This commit is contained in:
@@ -37,18 +37,21 @@ const LogIn = () => {
|
||||
|
||||
t.update('info', 'Creating token...')
|
||||
|
||||
// Use the Privy embedded wallet address
|
||||
const walletAddress = user.linkedAccounts[1]?.address
|
||||
// Use the Privy embedded wallet address for authentication
|
||||
const embeddedWalletAddress = user.linkedAccounts[1]?.address
|
||||
// Use the connected user wallet address as ownerWalletAddress
|
||||
const connectedWalletAddress = user.wallet?.address
|
||||
|
||||
if (signature && walletAddress) {
|
||||
if (signature && embeddedWalletAddress) {
|
||||
const userClient = new UserClient({}, apiUrl)
|
||||
|
||||
await userClient
|
||||
.user_CreateToken({
|
||||
address: walletAddress,
|
||||
address: embeddedWalletAddress,
|
||||
message: message,
|
||||
name: user?.id,
|
||||
signature: signature,
|
||||
ownerWalletAddress: connectedWalletAddress,
|
||||
})
|
||||
.then((data) => {
|
||||
setCookie('token', data, 1)
|
||||
|
||||
@@ -4523,6 +4523,7 @@ export interface User {
|
||||
agentName?: string | null;
|
||||
avatarUrl?: string | null;
|
||||
telegramChannel?: string | null;
|
||||
ownerWalletAddress?: string | null;
|
||||
isAdmin?: boolean;
|
||||
}
|
||||
|
||||
@@ -5863,6 +5864,7 @@ export interface LoginRequest {
|
||||
address: string;
|
||||
signature: string;
|
||||
message: string;
|
||||
ownerWalletAddress?: string | null;
|
||||
}
|
||||
|
||||
export interface PaginatedWhitelistAccountsResponse {
|
||||
|
||||
@@ -46,6 +46,7 @@ export interface User {
|
||||
agentName?: string | null;
|
||||
avatarUrl?: string | null;
|
||||
telegramChannel?: string | null;
|
||||
ownerWalletAddress?: string | null;
|
||||
isAdmin?: boolean;
|
||||
}
|
||||
|
||||
@@ -1386,6 +1387,7 @@ export interface LoginRequest {
|
||||
address: string;
|
||||
signature: string;
|
||||
message: string;
|
||||
ownerWalletAddress?: string | null;
|
||||
}
|
||||
|
||||
export interface PaginatedWhitelistAccountsResponse {
|
||||
|
||||
Reference in New Issue
Block a user