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

ENG-0000 fix(portal,1ui): Fix Privy auth issues #939

Merged
merged 11 commits into from
Nov 21, 2024

Conversation

0xjojikun
Copy link
Member

Affected Packages

Apps

  • data populator
  • portal
  • template

Packages

  • 1ui
  • api
  • graphql
  • protocol
  • sdk

Tools

  • tools

Overview

Overview of the changes in the PR.

Screen Captures

If applicable, add screenshots or screen captures of your changes.

Declaration

  • I hereby declare that I have abided by the rules and regulations as outlined in the CONTRIBUTING.md

Copy link
Member

@jonathanprozzi jonathanprozzi left a comment

Choose a reason for hiding this comment

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

Left comments in our thread too. Still reading through but want to surface current comments!

apps/portal/app/.client/privy-refresh.tsx Outdated Show resolved Hide resolved
apps/portal/app/.client/privy-refresh.tsx Show resolved Hide resolved
@@ -31,6 +32,10 @@ export default function PrivyLoginButton({
setLoading(true)
login()
}
useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

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

So this would force the logout to ensure it's cleared fully before logging in?

@0xjojikun 0xjojikun marked this pull request as ready for review November 21, 2024 19:44
@0xjojikun 0xjojikun enabled auto-merge (squash) November 21, 2024 19:46
Copy link
Member

@jonathanprozzi jonathanprozzi left a comment

Choose a reason for hiding this comment

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

Minor changes to remove console logs -- great job! Works very well! 🎉

useEffect(() => {
if (accessToken) {
// instead of revalidating, redirect to same route and replace true
console.log('Redirecting to', `${refreshPath}?redirectTo=${redirectTo}`)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log('Redirecting to', `${refreshPath}?redirectTo=${redirectTo}`)
logger('Redirecting to', `${refreshPath}?redirectTo=${redirectTo}`)

apps/portal/app/.client/privy-refresh.tsx Outdated Show resolved Hide resolved
apps/portal/app/.client/privy-refresh.tsx Outdated Show resolved Hide resolved
apps/portal/app/.client/privy-refresh.tsx Outdated Show resolved Hide resolved
apps/portal/app/.client/privy-refresh.tsx Show resolved Hide resolved
}

// Then get the full user object directly using the verified user ID
const user = await privyClient.getUserById(verifiedClaims.userId)
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

0xjojikun and others added 4 commits November 21, 2024 15:17
Co-authored-by: Jonathan Prozzi <[email protected]>
Signed-off-by: jojikun <[email protected]>
Co-authored-by: Jonathan Prozzi <[email protected]>
Signed-off-by: jojikun <[email protected]>
Co-authored-by: Jonathan Prozzi <[email protected]>
Signed-off-by: jojikun <[email protected]>
Co-authored-by: Jonathan Prozzi <[email protected]>
Signed-off-by: jojikun <[email protected]>
Copy link
Member

@jonathanprozzi jonathanprozzi left a comment

Choose a reason for hiding this comment

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

🎉 beast mode

@0xjojikun 0xjojikun merged commit 88abe2b into main Nov 21, 2024
3 checks passed
@0xjojikun 0xjojikun deleted the joji/eng-0000-adjust-privy-token-logic branch November 21, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants