#AuthContext not working

1 messages · Page 1 of 1 (latest)

violet granite
#

So I have group routes (main) and studio both with layout.tsx I wrapped the layouts in a context but I am still having issues where I can access register and login pages even though I am logged in. As a matter of fact if I navigate the pages I can go back to the landing page and still see the register and login links in the navbar.

Supposedly the layout must be at app level but then this duplicate layouts in my group routes.

timber apexBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

fringe sedgeBOT
# violet granite So I have group routes (main) and studio both with layout.tsx I wrapped the layo...
Please add more information to your question

Your question currently does not have sufficient information for people to be able to help. Please add more information to help us help you, for example: relevant code snippets, a reproduction repository, and/or more detailed error messages. See more info on how to ask a good question in https://discord.com/channels/752553802359505017/1138338531983491154 and #welcome message.

violet granite
#

So apparently I must have a layout in the app level to apply globally and it is working but in group routes I also need layouts in the route level. The problem is that I am getting either double layouts (double navbar) or the authcontext is not working.

spark aspen
#

you will need to share some code, preferably:

  1. your context implementation
  2. layout.tsx which contains auth context provider
  3. page.tsx or component.tsx that tries to access the context

Also try to keep components/ folder out of your app folder.