Skip to content

Conversation

nikgraf
Copy link
Collaborator

@nikgraf nikgraf commented Sep 16, 2025

No description provided.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Privy authentication as an alternative to the existing Geo Connect authentication flow. The implementation creates a dual-authentication system where users can authenticate either through the traditional Geo Connect flow or through the new Privy authentication.

  • Adds a new PrivatePrivyAppIdentity type and authentication flow that works alongside existing identity types
  • Integrates Privy authentication into the server websocket handling and React hooks
  • Creates a new example application demonstrating Privy login functionality

Reviewed Changes

Copilot reviewed 82 out of 86 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/hypergraph/src/store.ts Adds Privy identity state management with new state fields and action handlers
packages/hypergraph/src/privy-auth/privy-auth.ts Implements core Privy authentication logic including signup, login, and key management
packages/hypergraph/src/connect/types.ts Defines the PrivatePrivyAppIdentity type for Privy-based authentication
packages/hypergraph-react/src/HypergraphAppContext.tsx Updates React context to handle dual authentication states and Privy websocket connections
packages/hypergraph-react/src/hooks/*.ts Updates React hooks to work with both authentication types
apps/server/src/websocket.ts Adds server-side support for Privy authentication in websocket connections
apps/privy-login-example/ Complete example application demonstrating Privy authentication integration
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

apps/server/src/websocket.ts:1

  • The condition check is inverted. It should be if (!signaturePrivateKey) to check for missing signature private key, not the presence of it.
import * as HttpLayerRouter from '@effect/platform/HttpLayerRouter';

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}>) => {
if (!identity) {
if (!identity && !privyIdentity) {
throw new Error('No identity found');
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an extra space in the error message. It should be 'No identity found' instead of 'No identity found'.

Suggested change
throw new Error('No identity found');
throw new Error('No identity found');

Copilot uses AI. Check for mistakes.

Comment on lines +138 to +140
console.log('smartAccountWalletClient', smartAccountWalletClient);
console.log('address', smartAccountWalletClient.account.address);
console.log('is deployed', await isSmartAccountDeployed(smartAccountWalletClient));
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These console.log statements should be removed from production code or replaced with proper logging.

Copilot uses AI. Check for mistakes.

Comment on lines +251 to +252
console.log('identity', identity);
console.log('privyIdentity', privyIdentity);
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These console.log statements should be removed from production code or replaced with proper logging.

Copilot uses AI. Check for mistakes.

console.log('is deployed', await isSmartAccountDeployed(smartAccountWalletClient));
// This will prompt the user to sign a user operation to update the smart account
if (await smartAccountNeedsUpdate(smartAccountWalletClient, chain, rpcUrl)) {
console.log('updating smart account');
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This console.log statement should be removed from production code or replaced with proper logging.

Copilot uses AI. Check for mistakes.

// Create the client again to ensure we have the 7579 config now
return getSmartAccountWalletClient(smartAccountParams);
}
console.log('leaving getAndUpdateSmartAccount');
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This console.log statement should be removed from production code or replaced with proper logging.

Suggested change
console.log('leaving getAndUpdateSmartAccount');

Copilot uses AI. Check for mistakes.

@nikgraf nikgraf merged commit b780f76 into main Sep 16, 2025
6 checks passed
@nikgraf nikgraf deleted the ng/add-privy-login branch September 16, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant