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

Fix: Resolve multiple ClerkProvider issue and hide Reset HUD button when user is not authenticated #100

Closed
wants to merge 8 commits into from

Conversation

AtlantisPleb
Copy link
Contributor

@AtlantisPleb AtlantisPleb commented Aug 29, 2024

This PR addresses issue #93 by hiding the Reset HUD button when the user is not authenticated and resolves the issue of multiple <ClerkProvider> components in the React component tree.

Updated changes:

  1. Removed <ClerkProvider> from app/layout.tsx.
  2. Modified components/ClientResetHUDButton.tsx to include <ClerkProvider> and handle authentication.
  3. Created an inner AuthenticatedResetHUDButton component in ClientResetHUDButton.tsx that uses the useAuth hook.
  4. Ensured that the useAuth hook is only used in a client-side component.

These changes ensure that:

  • The Reset HUD button is only visible and accessible to authenticated users.
  • There is only one <ClerkProvider> in the React component tree.
  • Authentication logic is handled in a client-side component.

This approach should resolve both the authentication visibility issue and the server-side rendering problems with authentication.

Copy link

vercel bot commented Aug 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v2 🛑 Canceled (Inspect) Aug 29, 2024 4:31pm

Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

1 similar comment
Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

@AtlantisPleb AtlantisPleb changed the title Fix: Hide Reset HUD button when user is not authenticated Fix: Hide Reset HUD button when user is not authenticated (Updated approach) Aug 29, 2024
Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

@AtlantisPleb AtlantisPleb changed the title Fix: Hide Reset HUD button when user is not authenticated (Updated approach) Fix: Resolve multiple ClerkProvider issue and hide Reset HUD button when user is not authenticated Aug 29, 2024
Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

1 similar comment
Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

2 similar comments
Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

@AtlantisPleb
Copy link
Contributor Author

This got fucked up, I solved it myself

@AtlantisPleb AtlantisPleb deleted the issue-93-hide-refresh-button-when-unauthed branch August 29, 2024 23:48
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