JustATempest
JustATempest
Explore posts from servers
CCoder.com
Created by JustATempest on 9/14/2024 in #help
Github Single Sign On Unauthorized
No description
2 replies
TTCTheo's Typesafe Cult
Created by JustATempest on 7/24/2023 in #questions
Server Action. and Redux Thunk?
What is stopping me from creating a thunk that accepts a start transition as a parameter, That executes data on the server, then dispatches the result to the client. Well, an error is thrown when you take start transition as a parameter on a non-async outer function. Thunk does not like an async outer function. But other than that, nothing's telling me it's not impossible, should I look a little deeper. I'll tell you, I was getting really close to making it work. here's what I'm currently doing and I'm looking for a better way, and I adore server actions. The ultimate pattern for SSR data handling. My workaround is a rapper around a component that needs data. I do the initial load on the server, then pass the data into the component that needs it as the initial data. Using react router, I manually refresh when items are added or deleted from the database using the server components. The order is as follows, I optimistically dispatch the delete action on an element. I use a transition to delete the element from the server using the server action. I then handle any errors that may occur and dispatch a success or failure or depending on the result. At the end, I used router refresh to tell the server it needs to reload the initially. what I would like to do I would like to be able and to define a function just like you would for thunk and an API but with server actions. This would allow me to neatly, remove most state management from my components. This would let me to centralize error handling among everything else that redux is great for. I also get the great benefit of the initial load being handled by the server. The client would only be responsible for deleting or adding new items. Anybody have a clue on how I could achieve this?
1 replies
TTCTheo's Typesafe Cult
Created by JustATempest on 4/7/2023 in #questions
next auth limitations with server rendering?
https://github.com/KairuDeibisu/wysark Here's the skinny, I'm using planet scale for my back end then prisma to connect it to next JS. I'm using auth0 for authentication and role-based management. I'm using next auth to manage the session with the auth 0 provider. What feels like at random, changing components unrelated to authentication, it's causing the token in the middleware to become null only in production. While the navbar is reacting to the login as if the users logged in. This would mean, The use session hook is correctly getting a token. While the req.nextauth.token is not being set. I'm definitely overlooking something, but after 2 weeks, I decided I need help. Everything is working perfect on my local machine. This was an issue before because there was some special characters in my secret key that vercell did not like. But changing it worked, until I pushed a new change to nav bar today.
1 replies